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:
authorJoas Schilling <coding@schilljs.com>2021-02-15 11:53:22 +0300
committerJoas Schilling <coding@schilljs.com>2021-02-15 11:53:22 +0300
commit790a7bb331a8506667c07465c462260394c324fe (patch)
treee2d40aebc9ab8ae311840f2091378040c7bafc68
parente4d40f00955eb40a2d00cad0ac18d282ca77fc3c (diff)
Correctly remove temporary message from store when posting
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--src/components/NewMessageForm/NewMessageForm.vue2
-rw-r--r--src/store/messagesStore.js10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue
index 174476e0e..db372fad0 100644
--- a/src/components/NewMessageForm/NewMessageForm.vue
+++ b/src/components/NewMessageForm/NewMessageForm.vue
@@ -300,7 +300,7 @@ export default {
clearTimeout(timeout)
// If successful, deletes the temporary message from the store
- this.$store.dispatch('deleteMessage', temporaryMessage)
+ this.$store.dispatch('removeTemporaryMessageFromStore', temporaryMessage)
// And adds the complete version of the message received
// by the server
this.$store.dispatch('processMessage', response.data.ocs.data)
diff --git a/src/store/messagesStore.js b/src/store/messagesStore.js
index dd7ed356a..dba80cdbf 100644
--- a/src/store/messagesStore.js
+++ b/src/store/messagesStore.js
@@ -285,6 +285,16 @@ const actions = {
},
/**
+ * Remove temporary message from store after receiving the parsed one from server
+ *
+ * @param {object} context default store context;
+ * @param {object} message the temporary message;
+ */
+ removeTemporaryMessageFromStore(context, message) {
+ context.commit('deleteMessage', message)
+ },
+
+ /**
* @param {object} context default store context;
* @param {string} token Token of the conversation
* @param {string} id Id of the first known chat message