add local favorites friend

This commit is contained in:
pa
2026-02-11 22:38:15 +09:00
parent 6d76140e1d
commit 61a4176f47
9 changed files with 601 additions and 20 deletions

View File

@@ -101,6 +101,7 @@
useFavoriteStore,
useFriendStore,
useGameStore,
useGeneralSettingsStore,
useLocationStore,
useUserStore
} from '../../../stores';
@@ -114,6 +115,8 @@
const { t } = useI18n();
const generalSettingsStore = useGeneralSettingsStore();
const friendStore = useFriendStore();
const { vipFriends, onlineFriends, activeFriends, offlineFriends, friendsInSameInstance } =
storeToRefs(friendStore);
@@ -121,7 +124,8 @@
storeToRefs(useAppearanceSettingsStore());
const { gameLogDisabled } = storeToRefs(useAdvancedSettingsStore());
const { showUserDialog } = useUserStore();
const { favoriteFriendGroups, groupedByGroupKeyFavoriteFriends } = storeToRefs(useFavoriteStore());
const { favoriteFriendGroups, groupedByGroupKeyFavoriteFriends, localFriendFavorites } =
storeToRefs(useFavoriteStore());
const { lastLocation, lastLocationDestination } = storeToRefs(useLocationStore());
const { isGameRunning } = storeToRefs(useGameStore());
const { currentUser } = storeToRefs(useUserStore());
@@ -191,6 +195,30 @@
}
}
for (const selectedKey of generalSettingsStore.localFavoriteFriendsGroups) {
if (selectedKey.startsWith('local:')) {
const groupName = selectedKey.slice(6);
const userIds = localFriendFavorites.value?.[groupName];
if (userIds && userIds.length) {
const filteredFriends = vipFriends.value.filter((friend) => {
if (isSidebarGroupByInstance.value && isHideFriendsInSameInstance.value) {
return userIds.includes(friend.id) && !sameInstanceFriendId.value.has(friend.id);
}
return userIds.includes(friend.id);
});
if (filteredFriends.length > 0) {
result.push(
filteredFriends.map((item) => ({
groupName,
key: selectedKey,
...item
}))
);
}
}
}
}
return result.sort((a, b) => a[0].key.localeCompare(b[0].key));
});