mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
fix 404 handling in main dialog
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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
@@ -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;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -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;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user