diff options
author | marco <marcoambrosini@pm.me> | 2022-03-02 18:24:26 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-21 14:08:27 +0300 |
commit | dff5d31602ef81257a56dcb08872a7ccbe4d6385 (patch) | |
tree | 9d2ea45c43d518ed9f41782694e726d4b7726ad9 /src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue | |
parent | d3d8f124dca2ad6149abb867af8a6a71e181326a (diff) |
temp
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue index b3cbd66bd..5a5868cc7 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue @@ -111,7 +111,7 @@ <span>❤️</span> </template> </Button> - <EmojiPicker @select.stop=""> + <EmojiPicker @select="addReactionToMessage"> <Button type="tertiary"> <template #icon> <Plus :size="20" /> @@ -424,13 +424,19 @@ export default { }, addReactionToMessage(selectedEmoji) { - this.$store.dispatch('addReactionToMessage', { - token: this.token, - messageId: this.messageObject.id, - selectedEmoji, - }) - }, + // Add reaction only if user hasn't reacted yet + if (!this.$store.getters.userHasReacted(this.actorId, this.token, this.messageObject.id, selectedEmoji)) { + this.$store.dispatch('addReactionToMessage', { + token: this.token, + messageId: this.messageObject.id, + selectedEmoji, + actorId: this.actorId, + }) + } else { + console.debug('Current user has already reacted') + } + }, }, } </script> |