aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_reactions
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-06-09 16:11:15 -0400
committertusooa <tusooa@kazv.moe>2023-06-09 16:13:43 -0400
commit8ba22a248118dfd5869adc9da881794e464e564c (patch)
tree2ea4ef98a5180eaa46162e91a3399244af3c6c2c /src/components/emoji_reactions
parent624af7ed00b0edb2792f84cc83f6eeb7568798c4 (diff)
Fix react button not working if reaction accounts are not loaded
Diffstat (limited to 'src/components/emoji_reactions')
-rw-r--r--src/components/emoji_reactions/emoji_reactions.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/emoji_reactions/emoji_reactions.js b/src/components/emoji_reactions/emoji_reactions.js
index b4936424..4d5c6c5a 100644
--- a/src/components/emoji_reactions/emoji_reactions.js
+++ b/src/components/emoji_reactions/emoji_reactions.js
@@ -57,10 +57,10 @@ const EmojiReactions = {
reactedWith (emoji) {
return this.status.emoji_reactions.find(r => r.name === emoji).me
},
- fetchEmojiReactionsByIfMissing () {
+ async fetchEmojiReactionsByIfMissing () {
const hasNoAccounts = this.status.emoji_reactions.find(r => !r.accounts)
if (hasNoAccounts) {
- this.$store.dispatch('fetchEmojiReactionsBy', this.status.id)
+ return await this.$store.dispatch('fetchEmojiReactionsBy', this.status.id)
}
},
reactWith (emoji) {
@@ -69,9 +69,10 @@ const EmojiReactions = {
unreact (emoji) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
},
- emojiOnClick (emoji, event) {
+ async emojiOnClick (emoji, event) {
if (!this.loggedIn) return
+ await this.fetchEmojiReactionsByIfMissing()
if (this.reactedWith(emoji)) {
this.unreact(emoji)
} else {