diff --git a/src/stores/avatar.js b/src/stores/avatar.js index 21ec1deb..16cc7de7 100644 --- a/src/stores/avatar.js +++ b/src/stores/avatar.js @@ -319,6 +319,10 @@ export const useAvatarStore = defineStore('Avatar', () => { return ref; } + function resetCachedAvatarModerations() { + cachedAvatarModerations.clear(); + } + /** * */ @@ -797,6 +801,7 @@ export const useAvatarStore = defineStore('Avatar', () => { showAvatarDialog, applyAvatarModeration, + resetCachedAvatarModerations, getAvatarGallery, updateVRChatAvatarCache, getAvatarHistory, diff --git a/src/stores/friend.js b/src/stores/friend.js index 8ef3b45b..adb9c2c2 100644 --- a/src/stores/friend.js +++ b/src/stores/friend.js @@ -230,7 +230,7 @@ export const useFriendStore = defineStore('Friend', () => { state.friendNumber = 0; friendLog.clear(); friendLogTable.value.data = []; - groupStore.groupInstances = []; + groupStore.clearGroupInstances(); onlineFriendCount.value = 0; pendingOfflineMap.clear(); if (isLoggedIn) { @@ -273,7 +273,7 @@ export const useFriendStore = defineStore('Friend', () => { if (appearanceSettingsStore.randomUserColours) { getNameColour(userStore.currentUser.id).then((colour) => { - userStore.currentUser.$userColour = colour; + userStore.setCurrentUserColour(colour); }); } } @@ -1684,6 +1684,13 @@ export const useFriendStore = defineStore('Friend', () => { } } + /** + * @param {boolean} value + */ + function setRefreshFriendsLoading(value) { + isRefreshFriendsLoading.value = value; + } + return { state, @@ -1725,6 +1732,7 @@ export const useFriendStore = defineStore('Friend', () => { updateUserCurrentStatus, handleFriendAdd, handleFriendDelete, - initFriendLogHistoryTable + initFriendLogHistoryTable, + setRefreshFriendsLoading }; }); diff --git a/src/stores/group.js b/src/stores/group.js index ba313e0c..b1d40663 100644 --- a/src/stores/group.js +++ b/src/stores/group.js @@ -962,6 +962,10 @@ export const useGroupStore = defineStore('Group', () => { } } + function clearGroupInstances() { + groupInstances.value = []; + } + /** * * @param {object} json @@ -1197,6 +1201,7 @@ export const useGroupStore = defineStore('Group', () => { loadCurrentUserGroups, handleGroupPost, handleGroupUserInstances, + clearGroupInstances, handleGroupMember, handleGroupPermissions, handleGroupMemberProps, diff --git a/src/stores/moderation.js b/src/stores/moderation.js index 5773dbaf..c4e3fbf3 100644 --- a/src/stores/moderation.js +++ b/src/stores/moderation.js @@ -193,7 +193,7 @@ export const useModerationStore = defineStore('Moderation', () => { }) .then((res) => { // TODO: compare with cachedAvatarModerations - avatarStore.cachedAvatarModerations = new Map(); + avatarStore.resetCachedAvatarModerations(); if (res[1]?.json) { for (const json of res[1].json) { avatarStore.applyAvatarModeration(json); diff --git a/src/stores/settings/discordPresence.js b/src/stores/settings/discordPresence.js index 894e3d58..d3e0ad3b 100644 --- a/src/stores/settings/discordPresence.js +++ b/src/stores/settings/discordPresence.js @@ -442,7 +442,7 @@ export const useDiscordPresenceSettingsStore = defineStore( */ async function saveDiscordOption(configLabel = '') { state.lastLocationDetails.tag = ''; - updateLoopStore.nextDiscordUpdate = 3; + updateLoopStore.setNextDiscordUpdate(3); updateDiscord(); } diff --git a/src/stores/settings/general.js b/src/stores/settings/general.js index 647280b7..0c83c8fb 100644 --- a/src/stores/settings/general.js +++ b/src/stores/settings/general.js @@ -379,7 +379,7 @@ export const useGeneralSettingsStore = defineStore('GeneralSettings', () => { }) .then(async ({ ok, value }) => { if (ok) { - vrcxStore.proxyServer = value; + vrcxStore.setProxyServer(value); await VRCXStorage.Set( 'VRCX_ProxyServer', vrcxStore.proxyServer diff --git a/src/stores/updateLoop.js b/src/stores/updateLoop.js index d6a9fe90..c719c114 100644 --- a/src/stores/updateLoop.js +++ b/src/stores/updateLoop.js @@ -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 }; diff --git a/src/stores/user.js b/src/stores/user.js index 21ea25d9..9c1bf891 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -1980,6 +1980,13 @@ export const useUserStore = defineStore('User', () => { userDialog.value.memo = value; } + /** + * @param {string} value + */ + function setCurrentUserColour(value) { + currentUser.value.$userColour = value; + } + /** * */ @@ -2026,6 +2033,7 @@ export const useUserStore = defineStore('User', () => { handleConfig, showSendBoopDialog, setUserDialogMemo, + setCurrentUserColour, checkNote, toggleSharedConnectionsOptOut, toggleDiscordFriendsOptOut diff --git a/src/stores/vrcx.js b/src/stores/vrcx.js index 37350749..cf5c6c66 100644 --- a/src/stores/vrcx.js +++ b/src/stores/vrcx.js @@ -240,6 +240,13 @@ export const useVrcxStore = defineStore('Vrcx', () => { proxyServer.value = value; } + /** + * @param {boolean} value + */ + function setIpcEnabled(value) { + ipcEnabled.value = value; + } + /** * */ @@ -870,6 +877,7 @@ export const useVrcxStore = defineStore('Vrcx', () => { appStartAt, proxyServer, setProxyServer, + setIpcEnabled, currentlyDroppingFile, isRegistryBackupDialogVisible, ipcEnabled,