Fix VIP filter at startup for feed and gameLog

This commit is contained in:
Natsumi
2025-10-03 12:24:41 +13:00
parent d5082d894b
commit 61bc798b91
6 changed files with 31 additions and 11 deletions

View File

@@ -190,11 +190,11 @@
"announcement": "Event Announcement"
},
"group": {
"announcement": "Announcement",
"informative": "Informative",
"invite": "Invite",
"joinRequest": "Join Request",
"transfer": "Transfer",
"announcement": "Group Announcement",
"informative": "Group Informative",
"invite": "Group Invite",
"joinRequest": "Group Join Request",
"transfer": "Group Transfer",
"queueReady": "Queue Ready"
},
"moderation": {

View File

@@ -1,7 +1,8 @@
import { reactive } from 'vue';
const watchState = reactive({
isLoggedIn: false,
isFriendsLoaded: false
isFriendsLoaded: false,
isFavoritesLoaded: false
});
export { watchState };

View File

@@ -186,6 +186,7 @@ export const useAuthStore = defineStore('Auth', () => {
}
watchState.isLoggedIn = false;
watchState.isFriendsLoaded = false;
watchState.isFavoritesLoaded = false;
notificationStore.notificationInitStatus = false;
await updateStoredUser(userStore.currentUser);
webApiService.clearCookies();

View File

@@ -932,6 +932,7 @@ export const useFavoriteStore = defineStore('Favorite', () => {
refreshFavoriteGroups();
friendStore.updateLocalFavoriteFriends();
state.isFavoriteLoading = false;
watchState.isFavoritesLoaded = true;
}
});
}

View File

@@ -79,6 +79,15 @@ export const useFeedStore = defineStore('Feed', () => {
{ flush: 'sync' }
);
watch(
() => watchState.isFavoritesLoaded,
(isFavoritesLoaded) => {
if (isFavoritesLoaded && state.feedTable.vip) {
feedTableLookup(); // re-apply VIP filter after friends are loaded
}
}
);
function feedSearch(row) {
const value = state.feedTable.search.toUpperCase();
if (!value) {

View File

@@ -93,11 +93,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
state.gameLogTable.filter = JSON.parse(
await configRepository.getString('VRCX_gameLogTableFilters', '[]')
);
// gameLog loads before favorites
// await configRepository.getBool(
// 'VRCX_gameLogTableVIPFilter',
// false
// );
state.gameLogTable.vip = await configRepository.getBool(
'VRCX_gameLogTableVIPFilter',
false
);
}
init();
@@ -149,6 +148,15 @@ export const useGameLogStore = defineStore('GameLog', () => {
{ flush: 'sync' }
);
watch(
() => watchState.isFavoritesLoaded,
(isFavoritesLoaded) => {
if (isFavoritesLoaded && state.gameLogTable.vip) {
gameLogTableLookup(); // re-apply VIP filter after friends are loaded
}
}
);
watch(
() => watchState.isFriendsLoaded,
(isFriendsLoaded) => {