emoji reacts fix

This commit is contained in:
Henry Jameson 2026-08-28 19:51:10 +03:00
commit 8ca71beef0
3 changed files with 14 additions and 6 deletions

View file

@ -37,9 +37,9 @@ const EmojiReactions = {
},
accountsForEmoji() {
return this.status.emoji_reactions.reduce((acc, reaction) => {
acc[reaction.name] = reaction.accounts || []
acc.set(reaction.name, new Set(reaction.account_ids))
return acc
}, {})
}, new Map())
},
loggedIn() {
return !!useUsersStore().currentUser

View file

@ -52,7 +52,7 @@
</FALayers>
</component>
<UserListPopover
:users="accountsForEmoji[reaction.name]"
:user-ids="accountsForEmoji.get(reaction.name)"
class="emoji-reaction-popover"
:normal-button="true"
:trigger-attrs="counterTriggerAttrs(reaction)"

View file

@ -191,14 +191,22 @@ export const useStatusesStore = defineStore('statuses', {
id,
credentials: useOAuthStore().token,
}).then(({ data, timestamp }) => {
data.forEach((reaction) => {
const reactions = data.map((reaction) => {
const users = useUsersStore().addNewUsers({
timestamp,
data: reaction.accounts,
})
reaction.accounts = users
// Backend inconsistency - status data only has ids (account_ids)
// but reactions data has full info (accounts)
return {
...reaction,
accounts: users,
account_ids: users.map(({ id }) => id),
}
})
this.addEmojiReactionsBy(id, data)
this.addEmojiReactionsBy(id, reactions)
})
},
fetchFavs(id) {