Faster dialog switch

This commit is contained in:
Natsumi
2026-01-24 02:25:49 +13:00
committed by pa
parent fb9ec31c93
commit 0af08e7741
8 changed files with 9 additions and 14 deletions

View File

@@ -327,7 +327,7 @@
</div>
<TabsUnderline
v-model="avatarDialogActiveTab"
v-model="avatarDialog.activeTab"
:items="avatarDialogTabs"
:unmount-on-hide="false"
@update:modelValue="avatarDialogTabClick">
@@ -606,7 +606,6 @@
{ value: 'JSON', label: t('dialog.avatar.json.header') }
]);
const avatarDialogActiveTab = ref('Info');
const changeAvatarImageDialogVisible = ref(false);
const previousImageUrl = ref('');
@@ -677,7 +676,6 @@
);
function handleAvatarDialogTab(tabName) {
avatarDialogActiveTab.value = tabName;
avatarDialog.value.lastActiveTab = tabName;
if (tabName === 'JSON') {
refreshAvatarDialogTreeData();

View File

@@ -336,7 +336,7 @@
</div>
</div>
<TabsUnderline
v-model="groupDialogActiveTab"
v-model="groupDialog.activeTab"
:items="groupDialogTabs"
:unmount-on-hide="false"
@update:modelValue="groupDialogTabClick">
@@ -1236,7 +1236,6 @@
const { isDarkMode } = storeToRefs(useAppearanceSettingsStore());
const groupDialogActiveTab = ref('Info');
const isGroupMembersDone = ref(false);
const isGroupMembersLoading = ref(false);
const groupDialogGalleryCurrentName = ref('0');
@@ -1630,7 +1629,6 @@
}
function handleGroupDialogTab(tabName) {
groupDialogActiveTab.value = tabName;
groupDialog.value.lastActiveTab = tabName;
if (tabName === 'Members') {
getGroupDialogGroupMembers();

View File

@@ -14,7 +14,7 @@
:user-dialog-command="userDialogCommand" />
<TabsUnderline
v-model="userDialogActiveTab"
v-model="userDialog.activeTab"
:items="userDialogTabs"
:unmount-on-hide="false"
@update:modelValue="userDialogTabClick">
@@ -1407,7 +1407,6 @@
const userDialogGroupAllSelected = ref(false);
const userDialogGroupEditSelectedGroupIds = ref([]); // selected groups in edit mode
const userDialogActiveTab = ref('Info');
const userDialogLastMutualFriends = ref('');
const userDialogLastGroup = ref('');
const userDialogLastAvatar = ref('');
@@ -1519,7 +1518,6 @@
}
function handleUserDialogTab(tabName) {
userDialogActiveTab.value = tabName;
userDialog.value.lastActiveTab = tabName;
const userId = userDialog.value.id;
if (tabName === 'Info') {
@@ -1528,7 +1526,7 @@
}
} else if (tabName === 'mutual') {
if (userId === currentUser.value.id) {
userDialogActiveTab.value = 'Info';
userDialog.value.activeTab = 'Info';
userDialog.value.lastActiveTab = 'Info';
return;
}

View File

@@ -310,7 +310,7 @@
</div>
</div>
<TabsUnderline
v-model="worldDialogActiveTab"
v-model="worldDialog.activeTab"
:items="worldDialogTabs"
:unmount-on-hide="false"
@update:modelValue="worldDialogTabClick">
@@ -909,8 +909,6 @@
return platforms.join(', ');
});
const worldDialogActiveTab = ref('Instances');
watch(
() => worldDialog.value.loading,
() => {
@@ -922,7 +920,6 @@
);
function handleWorldDialogTab(tabName) {
worldDialogActiveTab.value = tabName;
worldDialog.value.lastActiveTab = tabName;
if (tabName === 'JSON') {
refreshWorldDialogTreeData();

View File

@@ -43,6 +43,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
const avatarDialog = ref({
visible: false,
loading: false,
activeTab: 'Info',
lastActiveTab: 'Info',
id: '',
memo: '',

View File

@@ -46,6 +46,7 @@ export const useGroupStore = defineStore('Group', () => {
const groupDialog = ref({
visible: false,
loading: false,
activeTab: 'Info',
lastActiveTab: 'Info',
isGetGroupDialogGroupLoading: false,
treeData: {},

View File

@@ -183,6 +183,7 @@ export const useUserStore = defineStore('User', () => {
const userDialog = ref({
visible: false,
loading: false,
activeTab: 'Info',
lastActiveTab: 'Info',
id: '',
ref: {},

View File

@@ -36,6 +36,7 @@ export const useWorldStore = defineStore('World', () => {
const worldDialog = reactive({
visible: false,
loading: false,
activeTab: 'Instances',
lastActiveTab: 'Instances',
id: '',
memo: '',