fix: directory conflict checking

pull/1030/head
Ramires Viana 2020-07-13 14:20:56 +00:00
parent a47b69bcec
commit 7e5beeff46
1 changed files with 3 additions and 6 deletions

View File

@ -6,10 +6,7 @@ export function checkConflict(files, items) {
items = [] items = []
} }
let folder_upload = false let folder_upload = files[0].fullPath !== undefined
if (files[0].fullPath !== undefined) {
folder_upload = true
}
let conflict = false let conflict = false
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
@ -69,7 +66,7 @@ export function scanFiles(dt) {
const dir = { const dir = {
isDir: true, isDir: true,
size: 0, size: 0,
path: `${directory}${entry.name}` fullPath: `${directory}${entry.name}`
} }
contents.push(dir) contents.push(dir)
@ -112,7 +109,7 @@ export function handleFiles(files, path, overwrite = false) {
if (file.isDir) { if (file.isDir) {
itemPath = path itemPath = path
let folders = file.path.split("/") let folders = file.fullPath.split("/")
for (let i = 0; i < folders.length; i++) { for (let i = 0; i < folders.length; i++) {
let folder = folders[i] let folder = folders[i]