diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index 6b9461e33..5c67d74f6 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -98,6 +98,15 @@ export default { } }, methods: { + addReaction (event) { + const emoji = event.insertion + 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 }) + } + }, doActionWrap (button) { if (button.name === 'emoji') { this.$refs.picker.showPicker()