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
path: root/src
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-11-06 21:28:28 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-02-09 19:38:17 +0300
commit9ca892308d0f46426563d7f07b95413016d715bb (patch)
treee97d786fa2dd9d7eba881786a67465da1686fa54 /src
parent0717fb14d8f660847787edf47e9fb154355dab1c (diff)
Add store action to discard an upload
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/UploadEditor.vue1
-rw-r--r--src/store/fileUploadStore.js13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/components/UploadEditor.vue b/src/components/UploadEditor.vue
index 00ca6a0d9..2258ac787 100644
--- a/src/components/UploadEditor.vue
+++ b/src/components/UploadEditor.vue
@@ -135,6 +135,7 @@ export default {
},
handleDismiss() {
+ this.$store.dispatch('discardUpload', this.currentUploadId)
this.modalDismissed = true
},
diff --git a/src/store/fileUploadStore.js b/src/store/fileUploadStore.js
index 85acf4ef6..f094d9d2b 100644
--- a/src/store/fileUploadStore.js
+++ b/src/store/fileUploadStore.js
@@ -187,6 +187,10 @@ const mutations = {
}
}
},
+
+ discardUpload(state, uploadId) {
+ Vue.delete(state.uploads, uploadId)
+ },
}
const actions = {
@@ -211,6 +215,15 @@ const actions = {
},
/**
+ * Discards an upload
+ * @param {object} param0 Commit and state
+ * @param {object} uploadId The unique uploadId
+ */
+ discardUpload({ commit, state, getters }, uploadId) {
+ commit('discardUpload', { uploadId })
+ },
+
+ /**
* Uploads the files to the root directory of the user
* @param {object} param0 Commit, state and getters
* @param {object} uploadId The unique uploadId