fix 404 handling in main dialog

This commit is contained in:
pa
2026-01-26 15:05:19 +09:00
committed by Natsumi
parent 27f913552e
commit 0a3597f84e
6 changed files with 22 additions and 11 deletions
@@ -98,12 +98,7 @@
get: () => activeComponent.value !== null, get: () => activeComponent.value !== null,
set: (value) => { set: (value) => {
if (!value) { if (!value) {
userStore.userDialog.visible = false; uiStore.closeMainDialog();
worldStore.worldDialog.visible = false;
avatarStore.avatarDialog.visible = false;
groupStore.groupDialog.visible = false;
instanceStore.hidePreviousInstancesDialogs();
uiStore.clearDialogCrumbs();
} }
} }
}); });
@@ -177,7 +172,7 @@
</script> </script>
<template> <template>
<Dialog v-model:open="isOpen"> <Dialog v-if="isOpen" v-model:open="isOpen">
<DialogContent :class="dialogClass" style="top: 10vh" :show-close-button="false"> <DialogContent :class="dialogClass" style="top: 10vh" :show-close-button="false">
<Breadcrumb v-if="shouldShowBreadcrumbs" class="mb-2"> <Breadcrumb v-if="shouldShowBreadcrumbs" class="mb-2">
<BreadcrumbList> <BreadcrumbList>
+1 -1
View File
@@ -216,7 +216,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
ref2.authorId !== userStore.currentUser.id ref2.authorId !== userStore.currentUser.id
) { ) {
D.loading = false; D.loading = false;
D.visible = false; uiStore.closeMainDialog();
return; return;
} }
} }
+1 -1
View File
@@ -164,7 +164,7 @@ export const useGroupStore = defineStore('Group', () => {
}) })
.catch((err) => { .catch((err) => {
D.loading = false; D.loading = false;
D.visible = false; uiStore.closeMainDialog();
toast.error(t('message.group.load_failed')); toast.error(t('message.group.load_failed'));
throw err; throw err;
}) })
+16
View File
@@ -112,6 +112,21 @@ export const useUiStore = defineStore('Ui', () => {
dialogCrumbs.value = []; dialogCrumbs.value = [];
} }
function closeMainDialog() {
const userStore = useUserStore();
const worldStore = useWorldStore();
const avatarStore = useAvatarStore();
const groupStore = useGroupStore();
const instanceStore = useInstanceStore();
userStore.userDialog.visible = false;
worldStore.worldDialog.visible = false;
avatarStore.avatarDialog.visible = false;
groupStore.groupDialog.visible = false;
instanceStore.hidePreviousInstancesDialogs();
clearDialogCrumbs();
}
function openDialog({ type, id, label = '', skipBreadcrumb = false }) { function openDialog({ type, id, label = '', skipBreadcrumb = false }) {
const userStore = useUserStore(); const userStore = useUserStore();
const worldStore = useWorldStore(); const worldStore = useWorldStore();
@@ -244,6 +259,7 @@ export const useUiStore = defineStore('Ui', () => {
setDialogCrumbLabel, setDialogCrumbLabel,
jumpDialogCrumb, jumpDialogCrumb,
clearDialogCrumbs, clearDialogCrumbs,
closeMainDialog,
openDialog openDialog
}; };
}); });
+1 -1
View File
@@ -845,7 +845,7 @@ export const useUserStore = defineStore('User', () => {
}) })
.catch((err) => { .catch((err) => {
D.loading = false; D.loading = false;
D.visible = false; uiStore.closeMainDialog();
toast.error(t('message.user.load_failed')); toast.error(t('message.user.load_failed'));
throw err; throw err;
}) })
+1 -1
View File
@@ -146,7 +146,7 @@ export const useWorldStore = defineStore('World', () => {
}) })
.catch((err) => { .catch((err) => {
D.loading = false; D.loading = false;
D.visible = false; uiStore.closeMainDialog();
toast.error(t('message.world.load_failed')); toast.error(t('message.world.load_failed'));
throw err; throw err;
}) })