summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorMarco Ambrosini <marcoambrosini@pm.me>2020-07-24 16:41:01 +0200
committerMarco Ambrosini <marcoambrosini@pm.me>2020-07-27 16:09:57 +0200
commit24e4fad7c71b3c40d9dcfe6037b567d778b370a6 (patch)
tree17bb5748a8264fd5782c73537425fd51ae523952 /src/utils
parentf9da295a0d8f9242a0b8ff5fe31b7e6f999c2248 (diff)
Delete temporary messages after sharing
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/fileUpload.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/fileUpload.js b/src/utils/fileUpload.js
index 687871537..217b3874c 100644
--- a/src/utils/fileUpload.js
+++ b/src/utils/fileUpload.js
@@ -72,6 +72,7 @@ const processFiles = async function(files, token, uploadId) {
await store.dispatch('uploadFiles', { uploadId, token, files })
// Get the files that have successfully been uploaded from the store
const shareableFiles = store.getters.getShareableFiles(uploadId)
+
// Share each of those files in the conversation
for (const index in shareableFiles) {
const path = shareableFiles[index].sharePath
@@ -79,6 +80,10 @@ const processFiles = async function(files, token, uploadId) {
store.dispatch('markFileAsSharing', { uploadId, index })
await shareFile(path, token)
store.dispatch('markFileAsShared', { uploadId, index })
+ const temporaryMessage = shareableFiles[index].temporaryMessage
+ // Delete temporary message
+ store.dispatch('deleteMessage', temporaryMessage)
+
} catch (exception) {
console.debug('An error happened when triying to share your file: ', exception)
}