use action from store instead of directly modifying state in components

This commit is contained in:
pa
2026-03-08 20:23:17 +09:00
parent b9c874bed0
commit ae0152c28e
9 changed files with 47 additions and 8 deletions

View File

@@ -98,7 +98,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
vrcxStore.tryAutoBackupVrcRegistry();
}
if (--state.ipcTimeout <= 0) {
vrcxStore.ipcEnabled = false;
vrcxStore.setIpcEnabled(false);
}
if (
--state.nextClearVRCXCacheCheck <= 0 &&
@@ -141,7 +141,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
}
}
} catch (err) {
friendStore.isRefreshFriendsLoading = false;
friendStore.setRefreshFriendsLoading(false);
console.error(err);
}
workerTimers.setTimeout(() => updateLoop(), 1000);
@@ -155,6 +155,10 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
state.nextGroupInstanceRefresh = value;
}
function setNextDiscordUpdate(value) {
state.nextDiscordUpdate = value;
}
return {
// state,
@@ -163,6 +167,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
nextDiscordUpdate,
ipcTimeout,
updateLoop,
setNextDiscordUpdate,
setNextGroupInstanceRefresh,
setNextClearVRCXCacheCheck
};