From 7354eb6cf966244141277c2808988855c004f908 Mon Sep 17 00:00:00 2001 From: Foxy Hunter <80623140+FoxyHunter7@users.noreply.github.com> Date: Sun, 29 Jun 2025 11:23:06 +0200 Subject: [PATCH] fix: exclude to-be-moved folder from move dialog (#5235) --- frontend/src/components/prompts/FileList.vue | 7 +++++++ frontend/src/components/prompts/Move.vue | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/components/prompts/FileList.vue b/frontend/src/components/prompts/FileList.vue index 2fd5ec71..6d3321b2 100644 --- a/frontend/src/components/prompts/FileList.vue +++ b/frontend/src/components/prompts/FileList.vue @@ -35,6 +35,12 @@ import { StatusError } from "@/api/utils.js"; export default { name: "file-list", + props: { + exclude: { + type: Array, + default: () => [], + }, + }, data: function () { return { items: [], @@ -90,6 +96,7 @@ export default { // move options. for (const item of req.items) { if (!item.isDir) continue; + if (this.exclude?.includes(item.url)) continue; this.items.push({ name: item.name, diff --git a/frontend/src/components/prompts/Move.vue b/frontend/src/components/prompts/Move.vue index 6591d09d..7b2fd615 100644 --- a/frontend/src/components/prompts/Move.vue +++ b/frontend/src/components/prompts/Move.vue @@ -8,6 +8,7 @@ @@ -76,6 +77,11 @@ export default { computed: { ...mapState(useFileStore, ["req", "selected"]), ...mapState(useAuthStore, ["user"]), + excludedFolders() { + return this.selected + .filter((idx) => this.req.items[idx].isDir) + .map((idx) => this.req.items[idx].url); + }, }, methods: { ...mapActions(useLayoutStore, ["showHover", "closeHovers"]),