Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marcoambrosini@pm.me>2022-03-17 16:52:24 +0300
committerJoas Schilling <coding@schilljs.com>2022-03-21 14:08:28 +0300
commit1b1e3f4ac9717ca1d8821c4c4dee924b9e6a9abf (patch)
tree2d10b486bfe02c36c665686d974be0a68faa6c8c /src/components/MessagesList/MessagesGroup/Message
parentcb3d53aa11f4cd57c7ac9f2432fa04ada31ed644 (diff)
Allow adding more reactions from the MessageButtonsBar
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/MessagesList/MessagesGroup/Message')
-rw-r--r--src/components/MessagesList/MessagesGroup/Message/Message.vue17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue
index 7cd2b911e..fc91ffdee 100644
--- a/src/components/MessagesList/MessagesGroup/Message/Message.vue
+++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue
@@ -137,7 +137,7 @@ the main body of the message as well as a quote.
</Popover>
<!-- More reactions picker -->
- <EmojiPicker :per-line="5">
+ <EmojiPicker :per-line="5" @select="addReactionToMessage">
<button class="reaction-button">
<EmoticonOutline :size="15" />
</button>
@@ -708,6 +708,21 @@ export default {
this.isDeleting = false
},
+
+ addReactionToMessage(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>