Fix avatar time spent and reload dialog when opening same dialog when no dialog is open

This commit is contained in:
Natsumi
2026-02-16 23:43:17 +11:00
committed by pa
parent 9b313e04ba
commit 5d36163eef
6 changed files with 19 additions and 15 deletions

View File

@@ -178,14 +178,14 @@ export const useAvatarStore = defineStore('Avatar', () => {
*/
function showAvatarDialog(avatarId) {
const D = avatarDialog.value;
uiStore.openDialog({
const isMainDialogOpen = uiStore.openDialog({
type: 'avatar',
id: avatarId
});
D.visible = true;
if (D.id === avatarId) {
if (isMainDialogOpen && D.id === avatarId) {
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
D.loading = false;
nextTick(() => (D.loading = false));
return;
}
D.loading = true;
@@ -213,7 +213,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
if (typeof ref2 !== 'undefined') {
D.ref = ref2;
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
D.loading = false;
nextTick(() => (D.loading = false));
}
avatarRequest
.getAvatar({ avatarId })