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
+5 -2
View File
@@ -203,8 +203,11 @@ namespace VRCX
} }
logger.Fatal(e, "Unhandled Exception, program dying"); logger.Fatal(e, "Unhandled Exception, program dying");
MessageBox.Show(e.ToString(), "PLEASE REPORT IN https://vrcx.app/discord", MessageBoxButtons.OK, var result = MessageBox.Show(e.ToString(), $"{Version} crashed, open Discord for support?", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
MessageBoxIcon.Error); if (result == DialogResult.Yes)
{
AppApiInstance.OpenLink("https://vrcx.app/discord");
}
Environment.Exit(0); Environment.Exit(0);
} }
} }
+4 -4
View File
@@ -178,14 +178,14 @@ export const useAvatarStore = defineStore('Avatar', () => {
*/ */
function showAvatarDialog(avatarId) { function showAvatarDialog(avatarId) {
const D = avatarDialog.value; const D = avatarDialog.value;
uiStore.openDialog({ const isMainDialogOpen = uiStore.openDialog({
type: 'avatar', type: 'avatar',
id: avatarId id: avatarId
}); });
D.visible = true; D.visible = true;
if (D.id === avatarId) { if (isMainDialogOpen && D.id === avatarId) {
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id); uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
D.loading = false; nextTick(() => (D.loading = false));
return; return;
} }
D.loading = true; D.loading = true;
@@ -213,7 +213,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
if (typeof ref2 !== 'undefined') { if (typeof ref2 !== 'undefined') {
D.ref = ref2; D.ref = ref2;
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id); uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
D.loading = false; nextTick(() => (D.loading = false));
} }
avatarRequest avatarRequest
.getAvatar({ avatarId }) .getAvatar({ avatarId })
+2 -2
View File
@@ -131,13 +131,13 @@ export const useGroupStore = defineStore('Group', () => {
if (!groupId) { if (!groupId) {
return; return;
} }
uiStore.openDialog({ const isMainDialogOpen = uiStore.openDialog({
type: 'group', type: 'group',
id: groupId id: groupId
}); });
const D = groupDialog.value; const D = groupDialog.value;
D.visible = true; D.visible = true;
if (D.id === groupId) { if (isMainDialogOpen && D.id === groupId) {
uiStore.setDialogCrumbLabel('group', D.id, D.ref?.name || D.id); uiStore.setDialogCrumbLabel('group', D.id, D.ref?.name || D.id);
instanceStore.applyGroupDialogInstances(); instanceStore.applyGroupDialogInstances();
D.loading = false; D.loading = false;
+1
View File
@@ -230,6 +230,7 @@ export const useUiStore = defineStore('Ui', () => {
clearDialogCrumbs(); clearDialogCrumbs();
} }
pushDialogCrumb(type, id, label); pushDialogCrumb(type, id, label);
return hadActiveDialog;
} }
// Make sure file drops outside of the screenshot manager don't navigate to the file path dropped. // Make sure file drops outside of the screenshot manager don't navigate to the file path dropped.
+2 -2
View File
@@ -778,13 +778,13 @@ export const useUserStore = defineStore('User', () => {
) { ) {
return; return;
} }
uiStore.openDialog({ const isMainDialogOpen = uiStore.openDialog({
type: 'user', type: 'user',
id: userId id: userId
}); });
const D = userDialog.value; const D = userDialog.value;
D.visible = true; D.visible = true;
if (D.id === userId) { if (isMainDialogOpen && D.id === userId) {
uiStore.setDialogCrumbLabel( uiStore.setDialogCrumbLabel(
'user', 'user',
D.id, D.id,
+5 -5
View File
@@ -1,4 +1,4 @@
import { reactive, shallowReactive, watch } from 'vue'; import { nextTick, reactive, shallowReactive, watch } from 'vue';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { toast } from 'vue-sonner'; import { toast } from 'vue-sonner';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@@ -82,15 +82,15 @@ export const useWorldStore = defineStore('World', () => {
if (L.worldId === '') { if (L.worldId === '') {
return; return;
} }
uiStore.openDialog({ const isMainDialogOpen = uiStore.openDialog({
type: 'world', type: 'world',
id: L.worldId id: L.worldId
}); });
D.visible = true; D.visible = true;
if (D.id === L.worldId) { if (isMainDialogOpen && D.id === L.worldId) {
uiStore.setDialogCrumbLabel('world', D.id, D.ref?.name || D.id); uiStore.setDialogCrumbLabel('world', D.id, D.ref?.name || D.id);
instanceStore.applyWorldDialogInstances(); instanceStore.applyWorldDialogInstances();
D.loading = false; nextTick(() => (D.loading = false));
return; return;
} }
L.shortName = shortName; L.shortName = shortName;
@@ -144,7 +144,7 @@ export const useWorldStore = defineStore('World', () => {
worldId: L.worldId worldId: L.worldId
}) })
.catch((err) => { .catch((err) => {
D.loading = false; nextTick(() => (D.loading = false));
D.id = null; D.id = null;
D.visible = false; D.visible = false;
uiStore.jumpBackDialogCrumb(); uiStore.jumpBackDialogCrumb();