mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Fix avatar time spent and reload dialog when opening same dialog when no dialog is open
This commit is contained in:
@@ -203,8 +203,11 @@ namespace VRCX
|
||||
}
|
||||
|
||||
logger.Fatal(e, "Unhandled Exception, program dying");
|
||||
MessageBox.Show(e.ToString(), "PLEASE REPORT IN https://vrcx.app/discord", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
var result = MessageBox.Show(e.ToString(), $"{Version} crashed, open Discord for support?", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
AppApiInstance.OpenLink("https://vrcx.app/discord");
|
||||
}
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -131,13 +131,13 @@ export const useGroupStore = defineStore('Group', () => {
|
||||
if (!groupId) {
|
||||
return;
|
||||
}
|
||||
uiStore.openDialog({
|
||||
const isMainDialogOpen = uiStore.openDialog({
|
||||
type: 'group',
|
||||
id: groupId
|
||||
});
|
||||
const D = groupDialog.value;
|
||||
D.visible = true;
|
||||
if (D.id === groupId) {
|
||||
if (isMainDialogOpen && D.id === groupId) {
|
||||
uiStore.setDialogCrumbLabel('group', D.id, D.ref?.name || D.id);
|
||||
instanceStore.applyGroupDialogInstances();
|
||||
D.loading = false;
|
||||
|
||||
@@ -230,6 +230,7 @@ export const useUiStore = defineStore('Ui', () => {
|
||||
clearDialogCrumbs();
|
||||
}
|
||||
pushDialogCrumb(type, id, label);
|
||||
return hadActiveDialog;
|
||||
}
|
||||
|
||||
// Make sure file drops outside of the screenshot manager don't navigate to the file path dropped.
|
||||
|
||||
@@ -778,13 +778,13 @@ export const useUserStore = defineStore('User', () => {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
uiStore.openDialog({
|
||||
const isMainDialogOpen = uiStore.openDialog({
|
||||
type: 'user',
|
||||
id: userId
|
||||
});
|
||||
const D = userDialog.value;
|
||||
D.visible = true;
|
||||
if (D.id === userId) {
|
||||
if (isMainDialogOpen && D.id === userId) {
|
||||
uiStore.setDialogCrumbLabel(
|
||||
'user',
|
||||
D.id,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { reactive, shallowReactive, watch } from 'vue';
|
||||
import { nextTick, reactive, shallowReactive, watch } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -82,15 +82,15 @@ export const useWorldStore = defineStore('World', () => {
|
||||
if (L.worldId === '') {
|
||||
return;
|
||||
}
|
||||
uiStore.openDialog({
|
||||
const isMainDialogOpen = uiStore.openDialog({
|
||||
type: 'world',
|
||||
id: L.worldId
|
||||
});
|
||||
D.visible = true;
|
||||
if (D.id === L.worldId) {
|
||||
if (isMainDialogOpen && D.id === L.worldId) {
|
||||
uiStore.setDialogCrumbLabel('world', D.id, D.ref?.name || D.id);
|
||||
instanceStore.applyWorldDialogInstances();
|
||||
D.loading = false;
|
||||
nextTick(() => (D.loading = false));
|
||||
return;
|
||||
}
|
||||
L.shortName = shortName;
|
||||
@@ -144,7 +144,7 @@ export const useWorldStore = defineStore('World', () => {
|
||||
worldId: L.worldId
|
||||
})
|
||||
.catch((err) => {
|
||||
D.loading = false;
|
||||
nextTick(() => (D.loading = false));
|
||||
D.id = null;
|
||||
D.visible = false;
|
||||
uiStore.jumpBackDialogCrumb();
|
||||
|
||||
Reference in New Issue
Block a user