diff --git a/frontend/src/components/Search.vue b/frontend/src/components/Search.vue index c723d6b1..8b04e420 100644 --- a/frontend/src/components/Search.vue +++ b/frontend/src/components/Search.vue @@ -95,7 +95,7 @@ export default { if (old === "search" && !this.active) { if (this.reload) { - this.setReload(true) + this.setReload({ value: true,isReset: false }) } document.body.style.overflow = "auto" diff --git a/frontend/src/components/files/Listing.vue b/frontend/src/components/files/Listing.vue index 60a50c80..6034d885 100644 --- a/frontend/src/components/files/Listing.vue +++ b/frontend/src/components/files/Listing.vue @@ -274,7 +274,7 @@ export default { let action = (overwrite, rename) => { api.copy(items, overwrite, rename).then(() => { - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) }).catch(this.$showError) } @@ -282,7 +282,7 @@ export default { action = (overwrite, rename) => { api.move(items, overwrite, rename).then(() => { this.$store.commit('resetClipboard') - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) }).catch(this.$showError) } } @@ -457,7 +457,7 @@ export default { this.$showError(e) } - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) } } } diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 8dabb418..1c4e3360 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -143,7 +143,7 @@ export default { let action = (overwrite, rename) => { api.move(items, overwrite, rename).then(() => { - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) }).catch(this.$showError) } diff --git a/frontend/src/components/prompts/Copy.vue b/frontend/src/components/prompts/Copy.vue index c8618b4f..3f4396d0 100644 --- a/frontend/src/components/prompts/Copy.vue +++ b/frontend/src/components/prompts/Copy.vue @@ -60,7 +60,7 @@ export default { buttons.success('copy') if (this.$route.path === this.dest) { - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) return } diff --git a/frontend/src/components/prompts/Delete.vue b/frontend/src/components/prompts/Delete.vue index 67cbb33e..2b4db442 100644 --- a/frontend/src/components/prompts/Delete.vue +++ b/frontend/src/components/prompts/Delete.vue @@ -56,11 +56,11 @@ export default { await Promise.all(promises) buttons.success('delete') - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) } catch (e) { buttons.done('delete') this.$showError(e) - if (this.isListing) this.$store.commit('setReload', true) + if (this.isListing) this.$store.commit('setReload', { value: true,isReset: false }) } } } diff --git a/frontend/src/components/prompts/Rename.vue b/frontend/src/components/prompts/Rename.vue index 1c130bc5..f8364d8a 100644 --- a/frontend/src/components/prompts/Rename.vue +++ b/frontend/src/components/prompts/Rename.vue @@ -77,7 +77,7 @@ export default { return } - this.$store.commit('setReload', true) + this.$store.commit('setReload', { value: true,isReset: false }) } catch (e) { this.$showError(e) } diff --git a/frontend/src/store/modules/upload.js b/frontend/src/store/modules/upload.js index 53307076..fabf465c 100644 --- a/frontend/src/store/modules/upload.js +++ b/frontend/src/store/modules/upload.js @@ -75,7 +75,7 @@ const actions = { window.removeEventListener('beforeunload', beforeUnload) buttons.success('upload') context.commit('reset') - context.commit('setReload', true, { root: true }) + context.commit('setReload', { value: true,isReset: false }, { root: true }) } if (canProcess) { diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index c0e03bfc..7362d72f 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -112,8 +112,10 @@ export default { }, watch: { '$route': 'fetchData', - 'reload': function () { - this.fetchData() + 'reload': function (newV) { + if (newV.isReset === false) { + this.fetchData() + } } }, mounted () { @@ -131,7 +133,7 @@ export default { ...mapMutations([ 'setLoading' ]), async fetchData () { // Reset view information. - this.$store.commit('setReload', false) + this.$store.commit('setReload', { value: false,isReset: true }) this.$store.commit('resetSelected') this.$store.commit('multiple', false) this.$store.commit('closeHovers')