Fix select avatar

This commit is contained in:
Natsumi
2025-07-16 07:31:38 +12:00
parent 4b7ebfc1eb
commit 0ab0378678
6 changed files with 25 additions and 34 deletions

View File

@@ -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}

View File

@@ -263,7 +263,7 @@
circle
:disabled="currentUser.currentAvatar === avatarDialog.id"
style="margin-left: 5px"
@click="selectAvatar(avatarDialog.id)"></el-button>
@click="selectAvatarWithoutConfirmation(avatarDialog.id)"></el-button>
</el-tooltip>
<el-dropdown
trigger="click"
@@ -644,7 +644,8 @@
const { showUserDialog, sortUserDialogAvatars } = useUserStore();
const { userDialog, currentUser } = storeToRefs(useUserStore());
const { avatarDialog, cachedAvatarModerations, cachedAvatars, cachedAvatarNames } = storeToRefs(useAvatarStore());
const { showAvatarDialog, getAvatarGallery, applyAvatarModeration, applyAvatar } = useAvatarStore();
const { showAvatarDialog, getAvatarGallery, applyAvatarModeration, applyAvatar, selectAvatarWithoutConfirmation } =
useAvatarStore();
const { showFavoriteDialog } = useFavoriteStore();
const { isGameRunning } = storeToRefs(useGameStore());
const { deleteVRChatCache } = useGameStore();
@@ -1006,20 +1007,6 @@
});
}
function selectAvatar(id) {
avatarRequest
.selectAvatar({
avatarId: id
})
.then((args) => {
$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,

View File

@@ -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
};

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -56,7 +56,7 @@
icon="el-icon-check"
circle
style="margin-left: 5px"
@click.stop="selectAvatarWithConfirmation"></el-button>
@click.stop="selectAvatarWithConfirmation(favorite.id)"></el-button>
</el-tooltip>
<el-tooltip
placement="right"
@@ -90,7 +90,7 @@
circle
style="margin-left: 5px"
icon="el-icon-check"
@click.stop="selectAvatarWithConfirmation" />
@click.stop="selectAvatarWithConfirmation(favorite.id)" />
</el-tooltip>
</template>
<el-tooltip