commit: cfa1a48bfb66d319ff0d7c24e7e936be147408f4
parent edb704339f11be049774a4f9b66ab125eaa93df1
Author: Henry Jameson <me@hjkos.com>
Date: Wed, 15 Jan 2025 12:48:25 +0200
emoji react
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git 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()