mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
fix main dialog flickr issue
This commit is contained in:
@@ -143,22 +143,18 @@
|
|||||||
}
|
}
|
||||||
uiStore.jumpDialogCrumb(index);
|
uiStore.jumpDialogCrumb(index);
|
||||||
if (item.type === 'user') {
|
if (item.type === 'user') {
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
userStore.showUserDialog(item.id, { skipBreadcrumb: true });
|
userStore.showUserDialog(item.id, { skipBreadcrumb: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.type === 'world') {
|
if (item.type === 'world') {
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
worldStore.showWorldDialog(item.id, null, { skipBreadcrumb: true });
|
worldStore.showWorldDialog(item.id, null, { skipBreadcrumb: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.type === 'avatar') {
|
if (item.type === 'avatar') {
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
avatarStore.showAvatarDialog(item.id, { skipBreadcrumb: true });
|
avatarStore.showAvatarDialog(item.id, { skipBreadcrumb: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.type === 'group') {
|
if (item.type === 'group') {
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
groupStore.showGroupDialog(item.id, { skipBreadcrumb: true });
|
groupStore.showGroupDialog(item.id, { skipBreadcrumb: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,13 +278,4 @@
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => dialogState.value?.openFlg,
|
|
||||||
() => {
|
|
||||||
if (dialogState.value?.visible) {
|
|
||||||
refreshTable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -18,13 +18,10 @@ import { database } from '../service/database';
|
|||||||
import { useAdvancedSettingsStore } from './settings/advanced';
|
import { useAdvancedSettingsStore } from './settings/advanced';
|
||||||
import { useAvatarProviderStore } from './avatarProvider';
|
import { useAvatarProviderStore } from './avatarProvider';
|
||||||
import { useFavoriteStore } from './favorite';
|
import { useFavoriteStore } from './favorite';
|
||||||
import { useGroupStore } from './group';
|
|
||||||
import { useInstanceStore } from './instance';
|
|
||||||
import { useModalStore } from './modal';
|
import { useModalStore } from './modal';
|
||||||
import { useUiStore } from './ui';
|
import { useUiStore } from './ui';
|
||||||
import { useUserStore } from './user';
|
import { useUserStore } from './user';
|
||||||
import { useVRCXUpdaterStore } from './vrcxUpdater';
|
import { useVRCXUpdaterStore } from './vrcxUpdater';
|
||||||
import { useWorldStore } from './world';
|
|
||||||
import { watchState } from '../service/watchState';
|
import { watchState } from '../service/watchState';
|
||||||
|
|
||||||
import webApiService from '../service/webapi';
|
import webApiService from '../service/webapi';
|
||||||
@@ -34,10 +31,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
|||||||
const avatarProviderStore = useAvatarProviderStore();
|
const avatarProviderStore = useAvatarProviderStore();
|
||||||
const vrcxUpdaterStore = useVRCXUpdaterStore();
|
const vrcxUpdaterStore = useVRCXUpdaterStore();
|
||||||
const advancedSettingsStore = useAdvancedSettingsStore();
|
const advancedSettingsStore = useAdvancedSettingsStore();
|
||||||
const instanceStore = useInstanceStore();
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const worldStore = useWorldStore();
|
|
||||||
const groupStore = useGroupStore();
|
|
||||||
const modalStore = useModalStore();
|
const modalStore = useModalStore();
|
||||||
const uiStore = useUiStore();
|
const uiStore = useUiStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -183,23 +177,11 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
|||||||
*/
|
*/
|
||||||
function showAvatarDialog(avatarId, options = {}) {
|
function showAvatarDialog(avatarId, options = {}) {
|
||||||
const D = avatarDialog.value;
|
const D = avatarDialog.value;
|
||||||
const hadActiveDialog =
|
|
||||||
avatarDialog.value.visible ||
|
|
||||||
userStore.userDialog.visible ||
|
|
||||||
worldStore.worldDialog.visible ||
|
|
||||||
groupStore.groupDialog.visible ||
|
|
||||||
instanceStore.previousInstancesInfoDialog.visible ||
|
|
||||||
instanceStore.previousInstancesListDialog.visible;
|
|
||||||
uiStore.openDialog({
|
uiStore.openDialog({
|
||||||
type: 'avatar',
|
type: 'avatar',
|
||||||
id: avatarId,
|
id: avatarId,
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
hadActiveDialog
|
|
||||||
});
|
});
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
userStore.userDialog.visible = false;
|
|
||||||
worldStore.worldDialog.visible = false;
|
|
||||||
groupStore.groupDialog.visible = false;
|
|
||||||
|
|
||||||
D.loading = true;
|
D.loading = true;
|
||||||
D.id = avatarId;
|
D.id = avatarId;
|
||||||
@@ -233,9 +215,11 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
|||||||
ref2.authorId !== userStore.currentUser.id
|
ref2.authorId !== userStore.currentUser.id
|
||||||
) {
|
) {
|
||||||
D.loading = false;
|
D.loading = false;
|
||||||
|
D.visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
D.visible = true;
|
||||||
avatarRequest
|
avatarRequest
|
||||||
.getAvatar({ avatarId })
|
.getAvatar({ avatarId })
|
||||||
.then((args) => {
|
.then((args) => {
|
||||||
@@ -247,7 +231,6 @@ export const useAvatarStore = defineStore('Avatar', () => {
|
|||||||
D.ref?.name || D.id
|
D.ref?.name || D.id
|
||||||
);
|
);
|
||||||
getAvatarGallery(avatarId);
|
getAvatarGallery(avatarId);
|
||||||
D.visible = true;
|
|
||||||
updateVRChatAvatarCache();
|
updateVRChatAvatarCache();
|
||||||
if (/quest/.test(ref.tags)) {
|
if (/quest/.test(ref.tags)) {
|
||||||
D.isQuestFallback = true;
|
D.isQuestFallback = true;
|
||||||
|
|||||||
@@ -135,24 +135,13 @@ export const useGroupStore = defineStore('Group', () => {
|
|||||||
if (!groupId) {
|
if (!groupId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hadActiveDialog =
|
|
||||||
groupDialog.value.visible ||
|
|
||||||
userStore.userDialog.visible ||
|
|
||||||
worldStore.worldDialog.visible ||
|
|
||||||
avatarStore.avatarDialog.visible ||
|
|
||||||
instanceStore.previousInstancesInfoDialog.visible ||
|
|
||||||
instanceStore.previousInstancesListDialog.visible;
|
|
||||||
uiStore.openDialog({
|
uiStore.openDialog({
|
||||||
type: 'group',
|
type: 'group',
|
||||||
id: groupId,
|
id: groupId,
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
hadActiveDialog
|
|
||||||
});
|
});
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
userStore.userDialog.visible = false;
|
|
||||||
worldStore.worldDialog.visible = false;
|
|
||||||
avatarStore.avatarDialog.visible = false;
|
|
||||||
const D = groupDialog.value;
|
const D = groupDialog.value;
|
||||||
|
D.visible = true;
|
||||||
D.loading = true;
|
D.loading = true;
|
||||||
D.id = groupId;
|
D.id = groupId;
|
||||||
D.inGroup = false;
|
D.inGroup = false;
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
|
|
||||||
const previousInstancesListDialog = ref({
|
const previousInstancesListDialog = ref({
|
||||||
visible: false,
|
visible: false,
|
||||||
openFlg: false,
|
|
||||||
variant: 'user',
|
variant: 'user',
|
||||||
userRef: {
|
userRef: {
|
||||||
id: '',
|
id: '',
|
||||||
@@ -148,9 +147,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
(isLoggedIn) => {
|
(isLoggedIn) => {
|
||||||
currentInstanceUsersData.value = [];
|
currentInstanceUsersData.value = [];
|
||||||
instanceJoinHistory.clear();
|
instanceJoinHistory.clear();
|
||||||
previousInstancesInfoDialog.value.visible = false;
|
hidePreviousInstancesDialogs();
|
||||||
previousInstancesListDialog.value.visible = false;
|
|
||||||
previousInstancesListDialog.value.openFlg = false;
|
|
||||||
cachedInstances.clear();
|
cachedInstances.clear();
|
||||||
queuedInstances.clear();
|
queuedInstances.clear();
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
@@ -188,7 +185,6 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
function hidePreviousInstancesDialogs() {
|
function hidePreviousInstancesDialogs() {
|
||||||
previousInstancesInfoDialog.value.visible = false;
|
previousInstancesInfoDialog.value.visible = false;
|
||||||
previousInstancesListDialog.value.visible = false;
|
previousInstancesListDialog.value.visible = false;
|
||||||
previousInstancesListDialog.value.openFlg = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resolveUserRef(input) {
|
async function resolveUserRef(input) {
|
||||||
@@ -290,24 +286,17 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showPreviousInstancesInfoDialog(instanceId, options = {}) {
|
function showPreviousInstancesInfoDialog(instanceId, options = {}) {
|
||||||
const hadActiveDialog =
|
|
||||||
userStore.userDialog.visible ||
|
|
||||||
worldStore.worldDialog.visible ||
|
|
||||||
groupStore.groupDialog.visible ||
|
|
||||||
previousInstancesInfoDialog.value.visible ||
|
|
||||||
previousInstancesListDialog.value.visible ||
|
|
||||||
uiStore.dialogCrumbs.length > 0;
|
|
||||||
hidePreviousInstancesDialogs();
|
|
||||||
previousInstancesInfoDialog.value.visible = true;
|
previousInstancesInfoDialog.value.visible = true;
|
||||||
previousInstancesInfoDialog.value.instanceId = instanceId;
|
previousInstancesInfoDialog.value.instanceId = instanceId;
|
||||||
|
uiStore.openDialog({
|
||||||
|
type: 'previous-instances-info',
|
||||||
|
id: instanceId || '',
|
||||||
|
label: instanceId
|
||||||
|
? formatPreviousInstancesInfoLabel(instanceId)
|
||||||
|
: '',
|
||||||
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
|
});
|
||||||
if (instanceId) {
|
if (instanceId) {
|
||||||
uiStore.openDialog({
|
|
||||||
type: 'previous-instances-info',
|
|
||||||
id: instanceId,
|
|
||||||
label: formatPreviousInstancesInfoLabel(instanceId),
|
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
|
||||||
hadActiveDialog
|
|
||||||
});
|
|
||||||
const location = parseLocation(instanceId);
|
const location = parseLocation(instanceId);
|
||||||
if (
|
if (
|
||||||
location.worldId &&
|
location.worldId &&
|
||||||
@@ -335,14 +324,6 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
targetRef,
|
targetRef,
|
||||||
options = {}
|
options = {}
|
||||||
) {
|
) {
|
||||||
const hadActiveDialog =
|
|
||||||
userStore.userDialog.visible ||
|
|
||||||
worldStore.worldDialog.visible ||
|
|
||||||
groupStore.groupDialog.visible ||
|
|
||||||
previousInstancesInfoDialog.value.visible ||
|
|
||||||
previousInstancesListDialog.value.visible ||
|
|
||||||
uiStore.dialogCrumbs.length > 0;
|
|
||||||
hidePreviousInstancesDialogs();
|
|
||||||
previousInstancesListDialog.value.variant = variant;
|
previousInstancesListDialog.value.variant = variant;
|
||||||
let resolved = null;
|
let resolved = null;
|
||||||
if (variant === 'user') {
|
if (variant === 'user') {
|
||||||
@@ -356,21 +337,18 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
previousInstancesListDialog.value.groupRef = resolved;
|
previousInstancesListDialog.value.groupRef = resolved;
|
||||||
}
|
}
|
||||||
previousInstancesListDialog.value.visible = true;
|
previousInstancesListDialog.value.visible = true;
|
||||||
previousInstancesListDialog.value.openFlg = true;
|
const dialogId = resolved?.id || '';
|
||||||
nextTick(() => (previousInstancesListDialog.value.openFlg = false));
|
const label = resolved?.id
|
||||||
if (resolved?.id) {
|
? variant === 'user'
|
||||||
const label =
|
? resolved.displayName || resolved.id
|
||||||
variant === 'user'
|
: resolved.name || resolved.id
|
||||||
? resolved.displayName || resolved.id
|
: '';
|
||||||
: resolved.name || resolved.id;
|
uiStore.openDialog({
|
||||||
uiStore.openDialog({
|
type: `previous-instances-${variant}`,
|
||||||
type: `previous-instances-${variant}`,
|
id: dialogId,
|
||||||
id: resolved.id,
|
label,
|
||||||
label,
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
});
|
||||||
hadActiveDialog
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCurrentInstanceWorld() {
|
function updateCurrentInstanceWorld() {
|
||||||
|
|||||||
@@ -8,8 +8,13 @@ import { AppDebug } from '../service/appConfig';
|
|||||||
import { refreshCustomCss } from '../shared/utils/base/ui';
|
import { refreshCustomCss } from '../shared/utils/base/ui';
|
||||||
import { updateLocalizedStrings } from '../plugin/i18n';
|
import { updateLocalizedStrings } from '../plugin/i18n';
|
||||||
import { useAppearanceSettingsStore } from './settings/appearance';
|
import { useAppearanceSettingsStore } from './settings/appearance';
|
||||||
|
import { useAvatarStore } from './avatar';
|
||||||
|
import { useGroupStore } from './group';
|
||||||
|
import { useInstanceStore } from './instance';
|
||||||
import { useNotificationStore } from './notification';
|
import { useNotificationStore } from './notification';
|
||||||
import { useSearchStore } from './search';
|
import { useSearchStore } from './search';
|
||||||
|
import { useUserStore } from './user';
|
||||||
|
import { useWorldStore } from './world';
|
||||||
|
|
||||||
export const useUiStore = defineStore('Ui', () => {
|
export const useUiStore = defineStore('Ui', () => {
|
||||||
const notificationStore = useNotificationStore();
|
const notificationStore = useNotificationStore();
|
||||||
@@ -107,13 +112,45 @@ export const useUiStore = defineStore('Ui', () => {
|
|||||||
dialogCrumbs.value = [];
|
dialogCrumbs.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDialog({
|
function openDialog({ type, id, label = '', skipBreadcrumb = false }) {
|
||||||
type,
|
const userStore = useUserStore();
|
||||||
id,
|
const worldStore = useWorldStore();
|
||||||
label = '',
|
const avatarStore = useAvatarStore();
|
||||||
skipBreadcrumb = false,
|
const groupStore = useGroupStore();
|
||||||
hadActiveDialog = false
|
const instanceStore = useInstanceStore();
|
||||||
}) {
|
const isPrevInfo = type === 'previous-instances-info';
|
||||||
|
const isPrevList =
|
||||||
|
type &&
|
||||||
|
type.startsWith('previous-instances-') &&
|
||||||
|
type !== 'previous-instances-info';
|
||||||
|
const hadActiveDialog =
|
||||||
|
dialogCrumbs.value.length > 0 ||
|
||||||
|
userStore.userDialog.visible ||
|
||||||
|
worldStore.worldDialog.visible ||
|
||||||
|
avatarStore.avatarDialog.visible ||
|
||||||
|
groupStore.groupDialog.visible ||
|
||||||
|
(instanceStore.previousInstancesInfoDialog.visible &&
|
||||||
|
!isPrevInfo) ||
|
||||||
|
(instanceStore.previousInstancesListDialog.visible && !isPrevList);
|
||||||
|
|
||||||
|
if (type !== 'user') {
|
||||||
|
userStore.userDialog.visible = false;
|
||||||
|
}
|
||||||
|
if (type !== 'world') {
|
||||||
|
worldStore.worldDialog.visible = false;
|
||||||
|
}
|
||||||
|
if (type !== 'avatar') {
|
||||||
|
avatarStore.avatarDialog.visible = false;
|
||||||
|
}
|
||||||
|
if (type !== 'group') {
|
||||||
|
groupStore.groupDialog.visible = false;
|
||||||
|
}
|
||||||
|
if (!isPrevInfo) {
|
||||||
|
instanceStore.previousInstancesInfoDialog.visible = false;
|
||||||
|
}
|
||||||
|
if (!isPrevList) {
|
||||||
|
instanceStore.previousInstancesListDialog.visible = false;
|
||||||
|
}
|
||||||
if (!hadActiveDialog) {
|
if (!hadActiveDialog) {
|
||||||
clearDialogCrumbs();
|
clearDialogCrumbs();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -767,24 +767,13 @@ export const useUserStore = defineStore('User', () => {
|
|||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hadActiveDialog =
|
|
||||||
userDialog.value.visible ||
|
|
||||||
worldStore.worldDialog.visible ||
|
|
||||||
avatarStore.avatarDialog.visible ||
|
|
||||||
groupStore.groupDialog.visible ||
|
|
||||||
instanceStore.previousInstancesInfoDialog.visible ||
|
|
||||||
instanceStore.previousInstancesListDialog.visible;
|
|
||||||
uiStore.openDialog({
|
uiStore.openDialog({
|
||||||
type: 'user',
|
type: 'user',
|
||||||
id: userId,
|
id: userId,
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
hadActiveDialog
|
|
||||||
});
|
});
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
worldStore.worldDialog.visible = false;
|
|
||||||
avatarStore.avatarDialog.visible = false;
|
|
||||||
groupStore.groupDialog.visible = false;
|
|
||||||
const D = userDialog.value;
|
const D = userDialog.value;
|
||||||
|
D.visible = true;
|
||||||
D.id = userId;
|
D.id = userId;
|
||||||
D.treeData = {};
|
D.treeData = {};
|
||||||
D.memo = '';
|
D.memo = '';
|
||||||
|
|||||||
@@ -84,24 +84,12 @@ export const useWorldStore = defineStore('World', () => {
|
|||||||
if (L.worldId === '') {
|
if (L.worldId === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hadActiveDialog =
|
|
||||||
worldDialog.visible ||
|
|
||||||
userStore.userDialog.visible ||
|
|
||||||
avatarStore.avatarDialog.visible ||
|
|
||||||
groupStore.groupDialog.visible ||
|
|
||||||
instanceStore.previousInstancesInfoDialog.visible ||
|
|
||||||
instanceStore.previousInstancesListDialog.visible;
|
|
||||||
uiStore.openDialog({
|
uiStore.openDialog({
|
||||||
type: 'world',
|
type: 'world',
|
||||||
id: L.worldId,
|
id: L.worldId,
|
||||||
skipBreadcrumb: options.skipBreadcrumb,
|
skipBreadcrumb: options.skipBreadcrumb
|
||||||
hadActiveDialog
|
|
||||||
});
|
});
|
||||||
D.visible = true;
|
D.visible = true;
|
||||||
instanceStore.hidePreviousInstancesDialogs();
|
|
||||||
userStore.userDialog.visible = false;
|
|
||||||
avatarStore.avatarDialog.visible = false;
|
|
||||||
groupStore.groupDialog.visible = false;
|
|
||||||
L.shortName = shortName;
|
L.shortName = shortName;
|
||||||
D.id = L.worldId;
|
D.id = L.worldId;
|
||||||
D.$location = L;
|
D.$location = L;
|
||||||
|
|||||||
Reference in New Issue
Block a user