From cbf883ab1e544bb26171ad6cd3b20d1f96ae1bcc Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 11 Aug 2022 18:14:05 +0100 Subject: [PATCH] fix "who reacted" emoji display fixes #80 --- .../emoji_reactions/emoji_reactions.js | 14 +++++++++- .../emoji_reactions/emoji_reactions.vue | 5 ++-- src/components/rich_content/rich_content.jsx | 28 ++++++++++--------- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js index bb11b840..549b9517 100644 --- a/src/components/emoji_reactions/emoji_reactions.js +++ b/src/components/emoji_reactions/emoji_reactions.js @@ -27,7 +27,11 @@ const EmojiReactions = { }, accountsForEmoji () { return this.status.emoji_reactions.reduce((acc, reaction) => { - acc[reaction.name] = reaction.accounts || [] + if (reaction.url) { + acc[reaction.url] = reaction.accounts || [] + } else { + acc[reaction.name] = reaction.accounts || [] + } return acc }, {}) }, @@ -42,6 +46,14 @@ const EmojiReactions = { reactedWith (emoji) { return this.status.emoji_reactions.find(r => r.name === emoji).me }, + isLocalReaction (emojiUrl) { + if (!emojiUrl) return true + const reacted = this.accountsForEmoji[emojiUrl] + if (reacted.length === 0) { + return true + } + return reacted[0].is_local + }, fetchEmojiReactionsByIfMissing () { const hasNoAccounts = this.status.emoji_reactions.find(r => !r.accounts) if (hasNoAccounts) { diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue index e76560bc..edc57d89 100644 --- a/src/components/emoji_reactions/emoji_reactions.vue +++ b/src/components/emoji_reactions/emoji_reactions.vue @@ -2,12 +2,13 @@