From 7b240cab348b56e695fe9a99b6bec8e07cc320c1 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 18 Apr 2017 10:46:41 +0300 Subject: [PATCH] fix(upload-files) upload a file to an empty root directory (#113) --- client/dom/upload-files.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/dom/upload-files.js b/client/dom/upload-files.js index 9c003b3d..c5eefebf 100644 --- a/client/dom/upload-files.js +++ b/client/dom/upload-files.js @@ -10,15 +10,18 @@ const load = require('./load'); const Images = require('./images'); const {FS} = require('../../common/cloudfunc'); -const {CurrentInfo} = DOM; const onEnd = wraptile(_onEnd); const loadFile = wraptile(_loadFile); +const { + getCurrentDirPath: getPathWhenRootEmpty +} = DOM; + module.exports = (dir, files) => { if (!files) { files = dir; - dir = CurrentInfo.dirPath; + dir = getPathWhenRootEmpty(); } const n = files.length;