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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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