diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-11-06 23:20:15 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-02-09 11:35:53 +0300 |
commit | 1c7032068bda43e6ea7d3638e6a6371f4794e6bd (patch) | |
tree | b2fd1877516b76d9a31cdc1468d0390b93754388 | |
parent | 8b07d425d201e4eb61863aeef769102c380961a3 (diff) |
Remove no longer needed "showUploadEditor"
As "showUploadEditor" is true only when "currentUploadId" is set and
false otherwise there is no need to use a separate variable.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | src/components/UploadEditor.vue | 2 | ||||
-rw-r--r-- | src/store/fileUploadStore.js | 14 |
2 files changed, 1 insertions, 15 deletions
diff --git a/src/components/UploadEditor.vue b/src/components/UploadEditor.vue index 59f694372..bd376dd15 100644 --- a/src/components/UploadEditor.vue +++ b/src/components/UploadEditor.vue @@ -97,7 +97,7 @@ export default { }, showModal() { - return this.$store.getters.showUploadEditor + return !!this.currentUploadId }, addMoreAriaLabel() { diff --git a/src/store/fileUploadStore.js b/src/store/fileUploadStore.js index de0b5f5e6..8086bb0be 100644 --- a/src/store/fileUploadStore.js +++ b/src/store/fileUploadStore.js @@ -35,7 +35,6 @@ const state = { uploads: { }, currentUploadId: undefined, - showUploadEditor: false, } const getters = { @@ -93,10 +92,6 @@ const getters = { currentUploadId: (state) => { return state.currentUploadId }, - - showUploadEditor: (state) => { - return state.showUploadEditor - }, } const mutations = { @@ -174,11 +169,6 @@ const mutations = { state.currentUploadId = currentUploadId }, - // Shows hides the upload editor - showUploadEditor(state, show) { - state.showUploadEditor = show - }, - removeFileFromSelection(state, fileId) { const uploadId = state.currentUploadId for (const key in state.uploads[uploadId].files) { @@ -198,8 +188,6 @@ const actions = { initialiseUpload({ commit, dispatch }, { uploadId, token, files }) { // Set last upload id commit('setCurrentUploadId', uploadId) - // Show upload editor - commit('showUploadEditor', true) files.forEach(file => { // Get localurl for previews @@ -222,7 +210,6 @@ const actions = { discardUpload({ commit, state, getters }, uploadId) { if (state.currentUploadId === uploadId) { commit('setCurrentUploadId', undefined) - commit('showUploadEditor', false) } commit('discardUpload', { uploadId }) @@ -236,7 +223,6 @@ const actions = { async uploadFiles({ commit, dispatch, state, getters }, uploadId) { if (state.currentUploadId === uploadId) { commit('setCurrentUploadId', undefined) - commit('showUploadEditor', false) } EventBus.$emit('uploadStart') |