use action from store instead of directly modifying state in components

This commit is contained in:
pa
2026-03-08 20:15:37 +09:00
parent 3d3ad27ca0
commit eeb5288027
13 changed files with 61 additions and 8 deletions
+8
View File
@@ -242,6 +242,13 @@ export const useAvatarStore = defineStore('Avatar', () => {
});
}
/**
* @param {boolean} value
*/
function setAvatarDialogLoading(value) {
avatarDialog.value.loading = value;
}
/**
*
* @param {string} avatarId
@@ -800,6 +807,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
lookupAvatars,
selectAvatarWithConfirmation,
selectAvatarWithoutConfirmation,
setAvatarDialogLoading,
showAvatarAuthorDialog,
addAvatarWearTime,
preloadOwnAvatars
+8
View File
@@ -149,6 +149,13 @@ export const useGlobalSearchStore = defineStore('GlobalSearch', () => {
isOpen.value = false;
}
/**
* @param {string} value
*/
function setQuery(value) {
query.value = value;
}
/**
* @param {{id: string, type: string}} item
*/
@@ -187,6 +194,7 @@ export const useGlobalSearchStore = defineStore('GlobalSearch', () => {
open,
close,
setQuery,
selectResult
};
});
+9 -1
View File
@@ -392,6 +392,13 @@ export const useNotificationStore = defineStore('Notification', () => {
});
}
/**
* @param {object} entry
*/
function appendNotificationTableEntry(entry) {
notificationTable.value.data.push(entry);
}
/**
*
* @param notificationId
@@ -1474,6 +1481,7 @@ export const useNotificationStore = defineStore('Notification', () => {
isNotificationExpired,
openNotificationLink,
queueMarkAsSeen,
markAllAsSeen
markAllAsSeen,
appendNotificationTableEntry
};
});
+5
View File
@@ -151,6 +151,10 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
state.nextClearVRCXCacheCheck = value;
}
function setNextGroupInstanceRefresh(value) {
state.nextGroupInstanceRefresh = value;
}
return {
// state,
@@ -159,6 +163,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
nextDiscordUpdate,
ipcTimeout,
updateLoop,
setNextGroupInstanceRefresh,
setNextClearVRCXCacheCheck
};
});
+8
View File
@@ -1973,6 +1973,13 @@ export const useUserStore = defineStore('User', () => {
sendBoopDialog.value.visible = true;
}
/**
* @param {string} value
*/
function setUserDialogMemo(value) {
userDialog.value.memo = value;
}
/**
*
*/
@@ -2018,6 +2025,7 @@ export const useUserStore = defineStore('User', () => {
getCurrentUser,
handleConfig,
showSendBoopDialog,
setUserDialogMemo,
checkNote,
toggleSharedConnectionsOptOut,
toggleDiscordFriendsOptOut
+8
View File
@@ -233,6 +233,13 @@ export const useVrcxStore = defineStore('Vrcx', () => {
}
}
/**
* @param {string} value
*/
function setProxyServer(value) {
proxyServer.value = value;
}
/**
*
*/
@@ -862,6 +869,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
appStartAt,
proxyServer,
setProxyServer,
currentlyDroppingFile,
isRegistryBackupDialogVisible,
ipcEnabled,
+8
View File
@@ -207,6 +207,13 @@ export const useWorldStore = defineStore('World', () => {
});
}
/**
* @param {boolean} value
*/
function setWorldDialogLoading(value) {
worldDialog.loading = value;
}
/**
*
*/
@@ -316,6 +323,7 @@ export const useWorldStore = defineStore('World', () => {
worldDialog,
cachedWorlds,
showWorldDialog,
setWorldDialogLoading,
updateVRChatWorldCache,
applyWorld,
preloadOwnWorlds