refactor: use setter functions for dialog visibility and favorite status in stores

This commit is contained in:
pa
2026-03-08 20:58:33 +09:00
parent ae0152c28e
commit c55d5f0ec7
19 changed files with 376 additions and 102 deletions
+12 -8
View File
@@ -155,27 +155,23 @@ export const useGameStore = defineStore('Game', () => {
if (isGameRunningArg !== isGameRunning.value) {
isGameRunning.value = isGameRunningArg;
if (isGameRunningArg) {
userStore.currentUser.$online_for = Date.now();
userStore.currentUser.$offline_for = '';
userStore.currentUser.$previousAvatarSwapTime = Date.now();
userStore.markCurrentUserGameStarted();
} else {
await configRepository.setBool('isGameNoVR', isGameNoVR.value);
userStore.currentUser.$online_for = 0;
userStore.currentUser.$offline_for = Date.now();
userStore.markCurrentUserGameStopped();
instanceStore.removeAllQueuedInstances();
autoVRChatCacheManagement();
checkIfGameCrashed();
updateLoopStore.ipcTimeout = 0;
updateLoopStore.setIpcTimeout(0);
avatarStore.addAvatarWearTime(
userStore.currentUser.currentAvatar
);
userStore.currentUser.$previousAvatarSwapTime = null;
}
locationStore.lastLocationReset();
gameLogStore.clearNowPlaying();
vrStore.updateVRLastLocation();
workerTimers.setTimeout(() => checkVRChatDebugLogging(), 60000);
updateLoopStore.nextDiscordUpdate = 0;
updateLoopStore.setNextDiscordUpdate(0);
console.log(new Date(), 'isGameRunning', isGameRunningArg);
}
@@ -194,6 +190,13 @@ export const useGameStore = defineStore('Game', () => {
}
}
/**
* @param {boolean} value
*/
function setIsGameNoVR(value) {
isGameNoVR.value = value;
}
async function checkVRChatDebugLogging() {
if (advancedSettingsStore.gameLogDisabled) {
return;
@@ -260,6 +263,7 @@ export const useGameStore = defineStore('Game', () => {
sweepVRChatCache,
getVRChatCacheSize,
updateIsGameRunning,
setIsGameNoVR,
getVRChatRegistryKey,
checkVRChatDebugLogging,
updateIsHmdAfk