Skip to content

Commit

Permalink
fix: directory conflict checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiresviana committed Jul 13, 2020
1 parent a47b69b commit 7e5beef
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frontend/src/utils/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 7e5beef

Please sign in to comment.