diff --git a/html/src/app.js b/html/src/app.js index 5c66afca..72a1d458 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9351,7 +9351,9 @@ speechSynthesis.getVoices(); } try { var response = await webApiService.execute({ - url: `https://www.googleapis.com/youtube/v3/videos?id=${encodeURIComponent(videoId)}&part=snippet,contentDetails&key=${apiKey}`, + url: `https://www.googleapis.com/youtube/v3/videos?id=${encodeURIComponent( + videoId + )}&part=snippet,contentDetails&key=${apiKey}`, method: 'GET', headers: { 'User-Agent': appVersion, @@ -10374,7 +10376,10 @@ speechSynthesis.getVoices(); this.addFriendship(id); } for (var id of this.friendLog.keys()) { - if (!set.has(id)) { + if (id === API.currentUser.id) { + this.friendLog.delete(id); + database.deleteFriendLogCurrent(id); + } else if (!set.has(id)) { this.deleteFriendship(id); } } @@ -10869,6 +10874,9 @@ speechSynthesis.getVoices(); $app.data.hideDevicesFromFeed = configRepository.getBool( 'VRCX_hideDevicesFromFeed' ); + $app.data.hideCpuUsageFromFeed = configRepository.getBool( + 'VRCX_hideCpuUsageFromFeed' + ); $app.data.overlayNotifications = configRepository.getBool( 'VRCX_overlayNotifications' ); @@ -10940,6 +10948,10 @@ speechSynthesis.getVoices(); 'VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed ); + configRepository.setBool( + 'VRCX_hideCpuUsageFromFeed', + this.hideCpuUsageFromFeed + ); configRepository.setBool( 'VRCX_overlayNotifications', this.overlayNotifications @@ -11418,6 +11430,7 @@ speechSynthesis.getVoices(); var VRConfigVars = { overlayNotifications: this.overlayNotifications, hideDevicesFromFeed: this.hideDevicesFromFeed, + hideCpuUsageFromFeed: this.hideCpuUsageFromFeed, minimalFeed: this.minimalFeed, notificationPosition: this.notificationPosition, notificationTimeout: this.notificationTimeout, @@ -12360,6 +12373,10 @@ speechSynthesis.getVoices(); .catch((err) => { D.loading = false; D.visible = false; + this.$message({ + message: 'Failed to load user', + type: 'error' + }); throw err; }) .then((args) => { @@ -13011,56 +13028,7 @@ speechSynthesis.getVoices(); return; } if (command === 'Refresh') { - D.loading = true; - API.getUser({ - userId: D.id - }) - .catch((err) => { - D.loading = false; - D.visible = false; - throw err; - }) - .then((args) => { - if (D.id === args.ref.id) { - D.loading = false; - D.ref = args.ref; - D.friend = this.friends.get(D.id); - D.isFriend = Boolean(D.friend); - D.incomingRequest = false; - D.outgoingRequest = false; - D.isBlock = false; - D.isMute = false; - D.isHideAvatar = false; - for (var ref of API.cachedPlayerModerations.values()) { - if ( - ref.$isDeleted === false && - ref.targetUserId === D.id && - ref.sourceUserId === API.currentUser.id - ) { - if (ref.type === 'block') { - D.isBlock = true; - } else if (ref.type === 'mute') { - D.isMute = true; - } else if (ref.type === 'hideAvatar') { - D.isHideAvatar = true; - } - } - } - D.isFavorite = API.cachedFavoritesByObjectId.has(D.id); - this.applyUserDialogLocation(); - API.getFriendStatus({ - userId: D.id - }); - var L = API.parseLocation(D.ref.location); - if (L.worldId && this.lastLocation.location !== L.tag) { - API.getInstance({ - worldId: L.worldId, - instanceId: L.instanceId - }); - } - } - return args; - }); + this.showUserDialog(D.id); } else if (command === 'Add Favorite') { this.showFavoriteDialog('friend', D.id); } else if (command === 'Edit Social Status') { @@ -13328,6 +13296,10 @@ speechSynthesis.getVoices(); .catch((err) => { D.loading = false; D.visible = false; + this.$message({ + message: 'Failed to load world', + type: 'error' + }); throw err; }) .then((args) => { @@ -13486,26 +13458,7 @@ speechSynthesis.getVoices(); } switch (command) { case 'Refresh': - D.loading = true; - API.getWorld({ - worldId: D.id - }) - .catch((err) => { - D.loading = false; - D.visible = false; - throw err; - }) - .then((args) => { - if (D.id === args.ref.id) { - D.loading = false; - D.ref = args.ref; - D.isFavorite = API.cachedFavoritesByObjectId.has( - D.id - ); - this.updateVRChatWorldCache(); - } - return args; - }); + this.showWorldDialog(D.id); break; case 'New Instance': this.showNewInstanceDialog(D.$location.tag); @@ -13756,6 +13709,15 @@ speechSynthesis.getVoices(); }); } }) + .catch((err) => { + D.loading = false; + D.visible = false; + this.$message({ + message: 'Failed to load avatar', + type: 'error' + }); + throw err; + }) .finally(() => { D.loading = false; }); diff --git a/html/src/index.pug b/html/src/index.pug index 17bfe364..ee3d10df 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1027,6 +1027,9 @@ html div.options-container-item span.name Hide VR Devices el-switch(v-model="hideDevicesFromFeed" @change="saveOpenVROption" :disabled="!openVR || !overlayWrist") + div.options-container-item + span.name Hide CPU Usage + el-switch(v-model="hideCpuUsageFromFeed" @change="saveOpenVROption" :disabled="!openVR || !overlayWrist") div.options-container-item el-button(size="small" icon="el-icon-notebook-2" @click="showWristFeedFiltersDialog" :disabled="!openVR || !overlayWrist") Wrist Feed Filters br diff --git a/html/src/vr.js b/html/src/vr.js index fab65d57..d12f9772 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -343,8 +343,10 @@ Vue.component('marquee-text', MarqueeText); $app.methods.updateStatsLoop = async function () { try { this.currentTime = new Date().toJSON(); - var cpuUsage = await AppApi.CpuUsage(); - this.cpuUsage = cpuUsage.toFixed(0); + if (!this.config.hideCpuUsageFromFeed) { + var cpuUsage = await AppApi.CpuUsage(); + this.cpuUsage = cpuUsage.toFixed(0); + } this.lastLocationTimer = ''; if (this.lastLocation.date !== 0) { diff --git a/html/src/vr.pug b/html/src/vr.pug index 733b66ea..1f4cae9f 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -398,7 +398,6 @@ html span(style="display:inline-block") {{ lastLocation.playerList.length }} span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? `‎‎‎‎‎‎‎‎‏‏‎ ‎(${lastLocation.friendList.length})` : ''}} span(v-if="photonLobbyBotSize > 0 && lastLocation.playerList.length > 0" style="display:inline-block;color:red;margin-left:5px") {{ photonLobbyBotSize }} - span(style="display:inline-block;margin-left:15px") {{ onlineFriendCount }} template(v-else) template(v-if="downloadProgress === 100") span(style="display:inline-block;margin-right:5px") Downloading: #[i.el-icon-loading] @@ -409,10 +408,10 @@ html span(style="display:inline-block") Players: {{ lastLocation.playerList.length }} span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? `‎‎‎‎‎‎‎‎‏‏‎ ‎(${lastLocation.friendList.length})` : ''}} span(v-if="photonLobbyBotSize > 0 && lastLocation.playerList.length > 0" style="display:inline-block;color:red;margin-left:5px") {{ photonLobbyBotSize }} - span(style="display:inline-block;margin-left:15px") Online: {{ onlineFriendCount }} br span(style="float:right") {{ currentTime | formatDate('YYYY-MM-DD HH:MI:SS AMPM') }} - span CPU {{ cpuUsage }}% + span(v-if="config && !config.hideCpuUsageFromFeed" style="display:inline-block;margin-right:5px") CPU: {{ cpuUsage }}% + span(style="display:inline-block") Online: {{ onlineFriendCount }} template(v-else) svg(class="np-progress-circle") circle(class="np-progress-circle-stroke" cx="60" cy="60" stroke="white" r="30" fill="transparent" stroke-width="60")