From cfa1a48bfb66d319ff0d7c24e7e936be147408f4 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 15 Jan 2025 12:48:25 +0200 Subject: [PATCH] emoji react --- src/components/status_action_buttons/action_button.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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()