diff --git a/frontend/src/api/files.ts b/frontend/src/api/files.ts index ed2de8ee..22c8151d 100644 --- a/frontend/src/api/files.ts +++ b/frontend/src/api/files.ts @@ -49,6 +49,12 @@ export async function fetch(url: string, signal?: AbortSignal) { return data; } +export async function fetchAll(url: string): Promise { + url = removePrefix(url); + const res = await fetchURL(`/api/resources/recursive${url}`, {}); + return (await res.json()) as RecursiveEntry[]; +} + async function resourceAction(url: string, method: ApiMethod, content?: any) { url = removePrefix(url); diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 813c0729..d6747f59 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -191,7 +191,6 @@ const drop = async (event: Event) => { return; } const path = el.__vue__.url; - const baseItems = (await api.fetch(path)).items; const action = (overwrite?: boolean, rename?: boolean) => { const action = @@ -205,7 +204,7 @@ const drop = async (event: Event) => { .catch($showError); }; - const conflict = upload.checkConflict(items, baseItems); + const conflict = await upload.checkConflict(items, path); if (conflict.length > 0) { layoutStore.showHover({ diff --git a/frontend/src/components/prompts/Copy.vue b/frontend/src/components/prompts/Copy.vue index 85810f30..a24f0fed 100644 --- a/frontend/src/components/prompts/Copy.vue +++ b/frontend/src/components/prompts/Copy.vue @@ -122,8 +122,7 @@ export default { }); }; - const dstItems = (await api.fetch(this.dest)).items; - const conflict = upload.checkConflict(items, dstItems); + const conflict = upload.checkConflict(items, this.dest); if (conflict.length > 0) { this.showHover({ diff --git a/frontend/src/components/prompts/Move.vue b/frontend/src/components/prompts/Move.vue index 36a92469..6970e0eb 100644 --- a/frontend/src/components/prompts/Move.vue +++ b/frontend/src/components/prompts/Move.vue @@ -122,8 +122,7 @@ export default { }); }; - const dstItems = (await api.fetch(this.dest)).items; - const conflict = upload.checkConflict(items, dstItems); + const conflict = upload.checkConflict(items, this.dest); if (conflict.length > 0) { this.showHover({ diff --git a/frontend/src/components/prompts/ResolveConflict.vue b/frontend/src/components/prompts/ResolveConflict.vue index e7bf9c74..993dbfb1 100644 --- a/frontend/src/components/prompts/ResolveConflict.vue +++ b/frontend/src/components/prompts/ResolveConflict.vue @@ -112,6 +112,16 @@ undo {{ $t("buttons.skipAll") }} +