fix local friend favorites

This commit is contained in:
pa
2026-02-11 23:14:42 +09:00
parent 1ef618f358
commit d8385ba89f
4 changed files with 69 additions and 13 deletions

View File

@@ -32,18 +32,22 @@
</div>
<div v-if="favoriteDialog.type === 'friend'" style="margin-top: 20px">
<span style="display: block; text-align: center">{{ t('dialog.favorite.local_favorites') }}</span>
<template v-for="group in localFriendFavoriteGroups" :key="group">
<template v-if="currentLocalFriendGroup">
<Button
variant="outline"
v-if="hasLocalFriendFavorite(favoriteDialog.objectId, group)"
style="width: 100%; white-space: initial"
class="my-1"
@click="removeLocalFriendFavorite(favoriteDialog.objectId, group)">
<Check />{{ group }} ({{ localFriendFavGroupLength(group) }})
@click="removeLocalFriendFavorite(favoriteDialog.objectId, currentLocalFriendGroup)">
<Check />{{ currentLocalFriendGroup }} ({{
localFriendFavGroupLength(currentLocalFriendGroup)
}})
</Button>
</template>
<template v-else>
<Button
variant="outline"
v-else
v-for="group in localFriendFavoriteGroups"
:key="group"
style="width: 100%; white-space: initial"
class="my-1"
@click="addLocalFriendFavorite(favoriteDialog.objectId, group)">
@@ -150,6 +154,16 @@
}
});
const currentLocalFriendGroup = computed(() => {
const objectId = favoriteDialog.value.objectId;
for (const group of localFriendFavoriteGroups.value) {
if (hasLocalFriendFavorite(objectId, group)) {
return group;
}
}
return null;
});
watch(
() => favoriteDialog.value.visible,
(value) => {