diff --git a/frontend/src/components/files/Listing.vue b/frontend/src/components/files/Listing.vue index 0ebc2a9c..6f811efb 100644 --- a/frontend/src/components/files/Listing.vue +++ b/frontend/src/components/files/Listing.vue @@ -248,7 +248,8 @@ export default { this.$store.commit('updateClipboard', { key: key, - items: items + items: items, + path: this.$route.path }) }, paste (event) { @@ -282,6 +283,12 @@ export default { } } + if (this.$store.state.clipboard.path == this.$route.path) { + action(false, true) + + return + } + let conflict = upload.checkConflict(items, this.req.items) let overwrite = false diff --git a/frontend/src/components/prompts/Copy.vue b/frontend/src/components/prompts/Copy.vue index d31b05df..c8618b4f 100644 --- a/frontend/src/components/prompts/Copy.vue +++ b/frontend/src/components/prompts/Copy.vue @@ -16,7 +16,6 @@ :title="$t('buttons.cancel')">{{ $t('buttons.cancel') }} @@ -59,6 +58,13 @@ export default { await api.copy(items, overwrite, rename).then(() => { buttons.success('copy') + + if (this.$route.path === this.dest) { + this.$store.commit('setReload', true) + + return + } + this.$router.push({ path: this.dest }) }).catch((e) => { buttons.done('copy') @@ -66,6 +72,13 @@ export default { }) } + if (this.$route.path === this.dest) { + this.$store.commit('closeHovers') + action(false, true) + + return + } + let dstItems = (await api.fetch(this.dest)).items let conflict = upload.checkConflict(items, dstItems) diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js index caefcf53..46aad6e6 100644 --- a/frontend/src/store/mutations.js +++ b/frontend/src/store/mutations.js @@ -78,6 +78,7 @@ const mutations = { updateClipboard: (state, value) => { state.clipboard.key = value.key state.clipboard.items = value.items + state.clipboard.path = value.path }, resetClipboard: (state) => { state.clipboard.key = ''