Emoji Reactions - fixes and improvements

This commit is contained in:
Shpuld Shpludson 2020-02-11 12:24:51 +00:00 committed by lain
parent 17b6d8ddb8
commit f6b482be51
18 changed files with 236 additions and 47 deletions

View file

@ -22,7 +22,12 @@ const ReactButton = {
this.showTooltip = false
},
addReaction (event, emoji) {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
const existingReaction = this.status.emoji_reactions.find(r => r.name === emoji)
if (existingReaction && existingReaction.me) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
} else {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
}
this.closeReactionSelect()
}
},