From c4e138250e35d2cddae8ea357418df3ec9779fc0 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Thu, 1 Sep 2022 20:03:08 +1200 Subject: [PATCH] Fix user dialog home world name --- html/src/app.js | 16 ++++++++++++++++ html/src/index.pug | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/html/src/app.js b/html/src/app.js index 5d1e021f..faebffdc 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -1262,6 +1262,14 @@ speechSynthesis.getVoices(); Object.assign(ref, json); if (ref.homeLocation !== ref.$homeLocation.tag) { ref.$homeLocation = this.parseLocation(ref.homeLocation); + // apply home location name to user dialog + if ($app.userDialog.visible && $app.userDialog.id === ref.id) { + API.getCachedWorld({ + worldId: API.currentUser.homeLocation + }).then((args) => { + $app.userDialog.$homeLocationName = args.ref.name; + }); + } } ref.$isVRCPlus = ref.tags.includes('system_supporter'); this.applyUserTrustLevel(ref); @@ -12908,6 +12916,7 @@ speechSynthesis.getVoices(); isFavorite: false, $location: {}, + $homeLocationName: '', users: [], instance: {}, @@ -13160,6 +13169,13 @@ speechSynthesis.getVoices(); D.previousDisplayNames = []; D.dateFriended = ''; D.unFriended = false; + if (userId === API.currentUser.id) { + API.getCachedWorld({ + worldId: API.currentUser.homeLocation + }).then((args) => { + D.$homeLocationName = args.ref.name; + }); + } API.getCachedUser({ userId }) diff --git a/html/src/index.pug b/html/src/index.pug index 644f419b..dcaef8a7 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1657,7 +1657,7 @@ html .detail span.name Home Location span.extra - location(:location="API.currentUser.homeLocation" :link="false") + span(v-text="userDialog.$homeLocationName") el-button(@click.stop="resetHome()" size="mini" icon="el-icon-delete" circle style="margin-left:5px") el-tab-pane(label="Worlds") el-button(type="default" :loading="userDialog.isWorldsLoading" @click="refreshUserDialogWorlds()" size="mini" icon="el-icon-refresh" circle)