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-02-21 17:57:44 +0300
committerJoas Schilling <coding@schilljs.com>2022-03-21 14:08:26 +0300
commitd2f05c1485eeb5d292f10e153b0cf7543f30dae4 (patch)
tree32a5f3730cf5a798ef3810068748f4c4c6f4f46a /src/store/messagesStore.js
parentaca33f5de29a267600960056ad8878c769a054b3 (diff)
Add store methods
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/store/messagesStore.js')
-rw-r--r--src/store/messagesStore.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/store/messagesStore.js b/src/store/messagesStore.js
index 282e18391..a2cd87515 100644
--- a/src/store/messagesStore.js
+++ b/src/store/messagesStore.js
@@ -967,23 +967,37 @@ const actions = {
return response
},
+ /**
+ * Adds a single reaction to a message for the current user.
+ *
+ * @param {*} context the context object
+ * @param {*} param1 conversation token, message id and selected emoji (string)
+ */
async addReactionToMessage(context, { token, messageId, selectedEmoji }) {
try {
- const response = await addReactionToMessage(token, messageId, selectedEmoji)
+ await addReactionToMessage(token, messageId, selectedEmoji)
context.commit('addReactionToMessage', { token, messageId, selectedEmoji })
-
- return response
} catch (error) {
console.debug(error)
}
},
+ /**
+ * Removes a single reactin to a message for the current user.
+ *
+ * @param {*} context the context object
+ * @param {*} param1 conversation token, message id and selected emoji (string)
+ */
async removeReactionToMessage(context, { token, messageId, selectedEmoji }) {
try {
- const response = await removeReactionFromMessage(token, messageId, selectedEmoji)
+ await removeReactionFromMessage(token, messageId, selectedEmoji)
context.commit('removeReactionFromMessage', { token, messageId, selectedEmoji })
+ } catch (error) {
+ console.debug(error)
+ }
+ },
/**
* Gets the full reactions array for a given message.