diff options
author | marco <marcoambrosini@pm.me> | 2022-02-21 17:57:44 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-21 14:08:26 +0300 |
commit | d2f05c1485eeb5d292f10e153b0cf7543f30dae4 (patch) | |
tree | 32a5f3730cf5a798ef3810068748f4c4c6f4f46a /src/store/messagesStore.js | |
parent | aca33f5de29a267600960056ad8878c769a054b3 (diff) |
Add store methods
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/store/messagesStore.js')
-rw-r--r-- | src/store/messagesStore.js | 22 |
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. |