remove ref.$groupRef

This commit is contained in:
pa
2025-10-26 22:42:18 +09:00
committed by Natsumi
parent d4ee092f5c
commit 4353eb7637

View File

@@ -262,10 +262,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
return; return;
} }
args.ref = ref; args.ref = ref;
if (ref.$groupRef !== null) {
ref.$groupRef.displayName = ref.displayName;
ref.$groupRef.visibility = ref.visibility;
}
} }
function handleFavoriteGroupClear(args) { function handleFavoriteGroupClear(args) {
@@ -316,10 +312,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
} }
function handleFavoriteAtDelete(args) { function handleFavoriteAtDelete(args) {
const { ref } = args;
if (ref.$groupRef !== null) {
--ref.$groupRef.count;
}
applyFavorite(args.ref.type, args.ref.favoriteId); applyFavorite(args.ref.type, args.ref.favoriteId);
friendStore.updateFriend(args.ref.favoriteId); friendStore.updateFriend(args.ref.favoriteId);
const userDialog = userStore.userDialog; const userDialog = userStore.userDialog;
@@ -332,7 +324,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
userDialog.isFavorite = false; userDialog.isFavorite = false;
} }
const favoriteStore = useFavoriteStore();
const worldDialog = worldStore.worldDialog; const worldDialog = worldStore.worldDialog;
if ( if (
!( !(
@@ -340,8 +331,9 @@ export const useFavoriteStore = defineStore('Favorite', () => {
worldDialog.id !== args.ref.favoriteId worldDialog.id !== args.ref.favoriteId
) )
) { ) {
worldDialog.isFavorite = worldDialog.isFavorite = localWorldFavoritesList.value.includes(
favoriteStore.localWorldFavoritesList.includes(worldDialog.id); worldDialog.id
);
} }
const avatarDialog = avatarStore.avatarDialog; const avatarDialog = avatarStore.avatarDialog;
@@ -625,7 +617,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
group.displayName = ref.displayName; group.displayName = ref.displayName;
} }
group.visibility = ref.visibility; group.visibility = ref.visibility;
ref.$groupRef = group;
assigns.add(ref.id); assigns.add(ref.id);
break; break;
} }
@@ -646,7 +637,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
group.key = `${group.type}:${ref.name}`; group.key = `${group.type}:${ref.name}`;
group.name = ref.name; group.name = ref.name;
group.displayName = ref.displayName; group.displayName = ref.displayName;
ref.$groupRef = group;
assigns.add(ref.id); assigns.add(ref.id);
break; break;
} }
@@ -660,7 +650,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
} }
} }
for (ref of cachedFavorites.values()) { for (ref of cachedFavorites.values()) {
ref.$groupRef = null;
if (ref.$isDeleted) { if (ref.$isDeleted) {
continue; continue;
} }
@@ -668,7 +657,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
if (typeof group === 'undefined') { if (typeof group === 'undefined') {
continue; continue;
} }
ref.$groupRef = group;
++group.count; ++group.count;
} }
} }
@@ -744,7 +732,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
// VRCX // VRCX
$isDeleted: false, $isDeleted: false,
$isExpired: false, $isExpired: false,
$groupRef: null,
// //
...json ...json
}; };
@@ -773,7 +760,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
$isDeleted: false, $isDeleted: false,
$isExpired: false, $isExpired: false,
$groupKey: '', $groupKey: '',
$groupRef: null,
// //
...json ...json
}; };
@@ -795,12 +781,11 @@ export const useFavoriteStore = defineStore('Favorite', () => {
} }
ref.$groupKey = `${ref.type}:${String(ref.tags[0])}`; ref.$groupKey = `${ref.type}:${String(ref.tags[0])}`;
if (ref.$isDeleted === false && ref.$groupRef === null) { if (ref.$isDeleted === false) {
const group = cachedFavoriteGroupsByTypeName.value.get( const group = cachedFavoriteGroupsByTypeName.value.get(
ref.$groupKey ref.$groupKey
); );
if (typeof group !== 'undefined') { if (typeof group !== 'undefined') {
ref.$groupRef = group;
++group.count; ++group.count;
} }
} }
@@ -1579,6 +1564,10 @@ export const useFavoriteStore = defineStore('Favorite', () => {
refreshFavorites(); refreshFavorites();
getLocalWorldFavorites(); getLocalWorldFavorites();
getLocalAvatarFavorites(); getLocalAvatarFavorites();
setTimeout(() => {
console.log(cachedFavorites);
}, 2000);
} }
return { return {
@@ -1618,7 +1607,6 @@ export const useFavoriteStore = defineStore('Favorite', () => {
refreshFavoriteGroups, refreshFavoriteGroups,
refreshFavorites, refreshFavorites,
applyFavoriteGroup, applyFavoriteGroup,
applyFavoriteCached,
refreshFavoriteAvatars, refreshFavoriteAvatars,
clearBulkFavoriteSelection, clearBulkFavoriteSelection,
showWorldImportDialog, showWorldImportDialog,