diff --git a/src/api/user.js b/src/api/user.js index 556fd7ad..3e6bb113 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -140,13 +140,6 @@ const userReq = { }); }, - /** - * @typedef {{ - * status: 'active' | 'offline' | 'busy' | 'ask me' | 'join me', - * statusDescription: string - * }} SaveCurrentUserParameters - */ - /** * Updates current user's status. * @type {import('../types/user').getCurrentUser} diff --git a/src/components/dialogs/AvatarDialog/AvatarDialog.vue b/src/components/dialogs/AvatarDialog/AvatarDialog.vue index 96fd2cf3..05800c6f 100644 --- a/src/components/dialogs/AvatarDialog/AvatarDialog.vue +++ b/src/components/dialogs/AvatarDialog/AvatarDialog.vue @@ -263,7 +263,7 @@ circle :disabled="currentUser.currentAvatar === avatarDialog.id" style="margin-left: 5px" - @click="selectAvatar(avatarDialog.id)"> + @click="selectAvatarWithoutConfirmation(avatarDialog.id)"> { - $message({ - message: 'Avatar changed', - type: 'success' - }); - return args; - }); - } - function promptChangeAvatarDescription(avatar) { $prompt(t('prompt.change_avatar_description.description'), t('prompt.change_avatar_description.header'), { distinguishCancelAndClose: true, diff --git a/src/stores/avatar.js b/src/stores/avatar.js index e8b349ba..4c2ab0ca 100644 --- a/src/stores/avatar.js +++ b/src/stores/avatar.js @@ -610,16 +610,15 @@ export const useAvatarStore = defineStore('Avatar', () => { }); return; } - avatarRequest + return avatarRequest .selectAvatar({ avatarId: id }) - .then((args) => { - new Noty({ - type: 'success', - text: 'Avatar changed via launch command' - }).show(); - return args; + .then(() => { + $app.$message({ + message: 'Avatar changed', + type: 'success' + }); }); } @@ -722,6 +721,7 @@ export const useAvatarStore = defineStore('Avatar', () => { getAvatarName, lookupAvatars, selectAvatarWithConfirmation, + selectAvatarWithoutConfirmation, showAvatarAuthorDialog, addAvatarWearTime }; diff --git a/src/stores/user.js b/src/stores/user.js index 4b9c7c62..12912fa1 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -1943,7 +1943,7 @@ export const useUserStore = defineStore('User', () => { last_platform: json.last_platform, // location - missing from currentUser // note - missing from currentUser - platform: json.presence.platform, + // platform - not always present profilePicOverride: json.profilePicOverride, profilePicOverrideThumbnail: json.profilePicOverrideThumbnail, pronouns: json.pronouns, @@ -1976,6 +1976,9 @@ export const useUserStore = defineStore('User', () => { userRef.$offline_for = state.currentUser.$offline_for; userRef.$location_at = state.currentUser.$location_at; userRef.$travelingToTime = state.currentUser.$travelingToTime; + if (json.presence?.platform) { + userRef.platform = json.presence.platform; + } return ref; } diff --git a/src/stores/vrcx.js b/src/stores/vrcx.js index 5f36aaa6..4d7debe5 100644 --- a/src/stores/vrcx.js +++ b/src/stores/vrcx.js @@ -30,6 +30,7 @@ import { useUpdateLoopStore } from './updateLoop'; import { useUserStore } from './user'; import { useWorldStore } from './world'; import { useI18n } from 'vue-i18n-bridge'; +import Noty from 'noty'; export const useVrcxStore = defineStore('Vrcx', () => { const gameStore = useGameStore(); @@ -617,7 +618,14 @@ export const useVrcxStore = defineStore('Vrcx', () => { // Makes sure the window is focused shouldFocusWindow = true; } else { - $app.selectAvatarWithoutConfirmation(avatarId); + avatarStore + .selectAvatarWithoutConfirmation(avatarId) + .then(() => { + new Noty({ + type: 'success', + text: 'Avatar changed via launch command' + }).show(); + }); shouldFocusWindow = false; } break; diff --git a/src/views/Favorites/components/FavoritesAvatarItem.vue b/src/views/Favorites/components/FavoritesAvatarItem.vue index ffdb049f..7c63fc4c 100644 --- a/src/views/Favorites/components/FavoritesAvatarItem.vue +++ b/src/views/Favorites/components/FavoritesAvatarItem.vue @@ -56,7 +56,7 @@ icon="el-icon-check" circle style="margin-left: 5px" - @click.stop="selectAvatarWithConfirmation"> + @click.stop="selectAvatarWithConfirmation(favorite.id)"> + @click.stop="selectAvatarWithConfirmation(favorite.id)" />