emoji reacts fix
This commit is contained in:
parent
08b06e7c01
commit
8ca71beef0
3 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)"
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue