mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 22:36:05 +02:00
add eslint rule to prevent direct store state mutation
This commit is contained in:
@@ -970,6 +970,27 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
friendImportDialogInput.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} avatarRef
|
||||
*/
|
||||
function syncLocalAvatarFavoriteRef(avatarRef) {
|
||||
if (!avatarRef?.id) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < localAvatarFavoriteGroups.value.length; ++i) {
|
||||
const groupName = localAvatarFavoriteGroups.value[i];
|
||||
const group = localAvatarFavorites[groupName];
|
||||
if (!group) {
|
||||
continue;
|
||||
}
|
||||
for (let j = 0; j < group.length; ++j) {
|
||||
if (group[j]?.id === avatarRef.id) {
|
||||
group[j] = avatarRef;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} worldId
|
||||
@@ -1892,6 +1913,7 @@ export const useFavoriteStore = defineStore('Favorite', () => {
|
||||
setAvatarImportDialogInput,
|
||||
setWorldImportDialogInput,
|
||||
setFriendImportDialogInput,
|
||||
syncLocalAvatarFavoriteRef,
|
||||
addLocalWorldFavorite,
|
||||
hasLocalWorldFavorite,
|
||||
hasLocalAvatarFavorite,
|
||||
|
||||
Reference in New Issue
Block a user