From 7e5beeff464e75ab185c430cd96e7cc67209ccc1 Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Mon, 13 Jul 2020 14:20:56 +0000 Subject: [PATCH] fix: directory conflict checking --- frontend/src/utils/upload.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/utils/upload.js b/frontend/src/utils/upload.js index 61e6a8e7..54b5669e 100644 --- a/frontend/src/utils/upload.js +++ b/frontend/src/utils/upload.js @@ -6,10 +6,7 @@ export function checkConflict(files, items) { items = [] } - let folder_upload = false - if (files[0].fullPath !== undefined) { - folder_upload = true - } + let folder_upload = files[0].fullPath !== undefined let conflict = false for (let i = 0; i < files.length; i++) { @@ -69,7 +66,7 @@ export function scanFiles(dt) { const dir = { isDir: true, size: 0, - path: `${directory}${entry.name}` + fullPath: `${directory}${entry.name}` } contents.push(dir) @@ -112,7 +109,7 @@ export function handleFiles(files, path, overwrite = false) { if (file.isDir) { itemPath = path - let folders = file.path.split("/") + let folders = file.fullPath.split("/") for (let i = 0; i < folders.length; i++) { let folder = folders[i]