Save current Favorites tab

This commit is contained in:
Natsumi
2025-10-22 19:37:48 +11:00
parent df9c062092
commit 6adef06a0d
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ const favoriteReq = {
/** /**
* *
* @param {{ type: string, group: string, displayName: string, visibility: string }} params group is a name * @param {{ type: string, group: string, displayName?: string, visibility?: string }} params group is a name
* @return { Promise<{json: any, params}> } * @return { Promise<{json: any, params}> }
*/ */
saveFavoriteGroup(params) { saveFavoriteGroup(params) {
+3
View File
@@ -34,6 +34,8 @@ export const useFavoriteStore = defineStore('Favorite', () => {
let cachedFavorites = new Map(); let cachedFavorites = new Map();
const currentFavoriteTab = ref('friend');
const cachedFavoriteGroups = ref(new Map()); const cachedFavoriteGroups = ref(new Map());
const cachedFavoriteGroupsByTypeName = ref(new Map()); const cachedFavoriteGroupsByTypeName = ref(new Map());
@@ -1609,6 +1611,7 @@ export const useFavoriteStore = defineStore('Favorite', () => {
cachedFavoritesByObjectId, cachedFavoritesByObjectId,
localWorldFavoriteGroups, localWorldFavoriteGroups,
groupedByGroupKeyFavoriteFriends, groupedByGroupKeyFavoriteFriends,
currentFavoriteTab,
initFavorites, initFavorites,
applyFavorite, applyFavorite,
+4 -4
View File
@@ -36,7 +36,7 @@
"></el-button> "></el-button>
</el-tooltip> </el-tooltip>
</div> </div>
<el-tabs v-model="currentTabName" v-loading="isFavoriteLoading" type="card" style="height: 100%"> <el-tabs v-model="currentFavoriteTab" v-loading="isFavoriteLoading" type="card" style="height: 100%">
<el-tab-pane name="friend" :label="t('view.favorite.friends.header')"> <el-tab-pane name="friend" :label="t('view.favorite.friends.header')">
<FavoritesFriendTab <FavoritesFriendTab
:edit-favorites-mode="editFavoritesMode" :edit-favorites-mode="editFavoritesMode"
@@ -86,7 +86,8 @@
localWorldFavoritesList, localWorldFavoritesList,
avatarImportDialogInput, avatarImportDialogInput,
worldImportDialogInput, worldImportDialogInput,
friendImportDialogInput friendImportDialogInput,
currentFavoriteTab
} = storeToRefs(useFavoriteStore()); } = storeToRefs(useFavoriteStore());
const { const {
refreshFavorites, refreshFavorites,
@@ -102,7 +103,6 @@
const editFavoritesMode = ref(false); const editFavoritesMode = ref(false);
const refreshingLocalFavorites = ref(false); const refreshingLocalFavorites = ref(false);
const currentTabName = ref('friend');
function showBulkUnfavoriteSelectionConfirm() { function showBulkUnfavoriteSelectionConfirm() {
const elementsTicked = []; const elementsTicked = [];
@@ -192,7 +192,7 @@
function handleBulkCopyFavoriteSelection() { function handleBulkCopyFavoriteSelection() {
let idList = ''; let idList = '';
switch (currentTabName.value) { switch (currentFavoriteTab.value) {
case 'friend': case 'friend':
for (const ctx of favoriteFriends.value) { for (const ctx of favoriteFriends.value) {
if (ctx.$selected) { if (ctx.$selected) {