diff --git a/html/src/app.js b/html/src/app.js index 5034f253..e5032621 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -1524,6 +1524,19 @@ speechSynthesis.getVoices(); ref.$isVRCPlus = ref.tags.includes('system_supporter'); this.applyUserTrustLevel(ref); this.applyUserLanguage(ref); + // update group list + if (json.presence?.groups) { + for (var groupId of json.presence.groups) { + if (!this.currentUserGroups.has(groupId)) { + $app.onGroupJoined(groupId); + } + } + for (var groupId of this.currentUserGroups.keys()) { + if (!json.presence.groups.includes(groupId)) { + $app.onGroupLeft(groupId); + } + } + } } else { ref = { id: '', @@ -3636,7 +3649,6 @@ speechSynthesis.getVoices(); this.isFavoriteLoading = false; this.isFavoriteGroupLoading = false; this.refreshFavorites(); - $app.getCurrentUserGroups(); }); API.$on('FAVORITE', function (args) { @@ -4317,6 +4329,7 @@ speechSynthesis.getVoices(); // #region | API: WebSocket API.webSocket = null; + API.lastWebSocketMessage = ''; API.$on('LOGOUT', function () { this.closeWebSocket(); @@ -4352,6 +4365,7 @@ speechSynthesis.getVoices(); return; } if (typeof content.user !== 'undefined') { + // I forgot about this... delete content.user.state; } switch (type) { @@ -4585,31 +4599,22 @@ speechSynthesis.getVoices(); userId: content.userId } }); + + // update current user location + API.currentUser.location = content.location; + API.currentUser.presence.instance = content.instance; + API.currentUser.presence.world = content.world?.id; + break; case 'group-joined': var groupId = content.groupId; - if ( - $app.groupDialog.visible && - $app.groupDialog.id === groupId - ) { - $app.showGroupDialog(groupId); - } - if (!this.currentUserGroups.has(groupId)) { - this.currentUserGroups.set(groupId); - this.getGroup({ groupId }); - } + $app.onGroupJoined(groupId); break; case 'group-left': var groupId = content.groupId; - if ( - $app.groupDialog.visible && - $app.groupDialog.id === groupId - ) { - $app.showGroupDialog(groupId); - } - this.currentUserGroups.delete(groupId); + $app.onGroupLeft(groupId); break; case 'group-member-updated': @@ -4674,6 +4679,11 @@ speechSynthesis.getVoices(); }; socket.onmessage = ({ data }) => { try { + if (this.lastWebSocketMessage === data) { + // pls no spam + return; + } + this.lastWebSocketMessage = data; var json = JSON.parse(data); try { json.content = JSON.parse(json.content); @@ -8671,6 +8681,7 @@ speechSynthesis.getVoices(); // eslint-disable-next-line require-atomic-updates $app.notificationTable.data = await database.getNotifications(); await this.refreshNotifications(); + await $app.getCurrentUserGroups(); if (configRepository.getBool(`friendLogInit_${args.json.id}`)) { await $app.getFriendLog(); } else { @@ -25330,6 +25341,25 @@ speechSynthesis.getVoices(); }); }; + $app.methods.onGroupJoined = function (groupId) { + if (this.groupDialog.visible && this.groupDialog.id === groupId) { + this.showGroupDialog(groupId); + } + if (!API.currentUserGroups.has(groupId)) { + API.currentUserGroups.set(groupId); + if (this.friendLogInitStatus) { + API.getGroup({ groupId }); + } + } + }; + + $app.methods.onGroupLeft = function (groupId) { + if (this.groupDialog.visible && this.groupDialog.id === groupId) { + this.showGroupDialog(groupId); + } + API.currentUserGroups.delete(groupId); + }; + // group members $app.data.isGroupMembersLoading = false; diff --git a/html/src/index.pug b/html/src/index.pug index dcea952c..3c917d9b 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -786,7 +786,8 @@ html span.extra(v-else) - el-tab-pane(:label="$t('dialog.avatar.json.header')") el-button(type="default" @click="refreshAvatarDialogTreeData()" size="mini" icon="el-icon-refresh" circle) - el-button(type="default" @click="getAvatarFileAnalysis" size="mini" icon="el-icon-question" circle style="margin-left:5px") + el-tooltip(placement="top" :content="$t('dialog.avatar.json.file_analysis')" :disabled="hideTooltips") + el-button(type="default" @click="getAvatarFileAnalysis" size="mini" icon="el-icon-question" circle style="margin-left:5px") el-button(type="default" @click="downloadAndSaveJson(avatarDialog.id, avatarDialog.ref)" size="mini" icon="el-icon-download" circle style="margin-left:5px") el-tree(v-if="Object.keys(avatarDialog.fileAnalysis).length > 0" :data="avatarDialog.fileAnalysis" style="margin-top:5px;font-size:12px") template(#default="scope") diff --git a/html/src/localization/strings/en.json b/html/src/localization/strings/en.json index be800b44..9ff8c835 100644 --- a/html/src/localization/strings/en.json +++ b/html/src/localization/strings/en.json @@ -410,6 +410,8 @@ "header": "VRCX Instance Cache/Debug", "udon_exception_logging": "Udon Exception Logging", "gpu_fix": "SteamVR Overlay GPU Fix", + "gpu_fix_notice": "(requires restart)", + "gpu_fix_warning": "Only enable this option if the SteamVR overlay isn't working and you have 2 GPUs", "disable_gamelog": "Disable GameLog", "disable_gamelog_notice": "(will likely break things)", "user_cache": "User cache:", @@ -695,7 +697,8 @@ "platform": "Platform" }, "json": { - "header": "JSON" + "header": "JSON", + "file_analysis": "File Analysis" } }, "group": { diff --git a/html/src/mixins/tabs/settings.pug b/html/src/mixins/tabs/settings.pug index 29521572..448128f5 100644 --- a/html/src/mixins/tabs/settings.pug +++ b/html/src/mixins/tabs/settings.pug @@ -469,7 +469,12 @@ mixin settingsTab() el-button-group(style="display:block") el-button(size="small" icon="el-icon-s-operation" @click="promptSetPendingOffline") {{ $t('view.settings.advanced.advanced.pending_offline.set_delay') }} +simpleSwitch("view.settings.advanced.advanced.cache_debug.udon_exception_logging", "udonExceptionLogging", "saveOpenVROption") - +simpleSwitch("view.settings.advanced.advanced.cache_debug.gpu_fix", "gpuFix", "saveVRCXWindowOption") + div.options-container-item + span.name {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix') }} + el-tooltip(placement="top" style="margin-left:5px" :content="$t('view.settings.advanced.advanced.cache_debug.gpu_fix_warning')") + i.el-icon-warning + el-switch(v-model="gpuFix" @change="saveVRCXWindowOption") + span.name(style="margin-left:15px") {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix_notice') }} div.options-container-item span.name {{ $t('view.settings.advanced.advanced.cache_debug.disable_gamelog') }} el-switch(v-model="gameLogDisabled" @change="disableGameLogDialog")