From 94d568b4de385ebad90bbba2c6d020c17dd169bb Mon Sep 17 00:00:00 2001 From: jykim Date: Tue, 14 Jun 2016 17:30:36 +0900 Subject: [PATCH] issue 3046 --- app/bower.json | 2 +- app/src/native_controll.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/bower.json b/app/bower.json index c20f13f0a..c4fe8e3ba 100644 --- a/app/bower.json +++ b/app/bower.json @@ -6,7 +6,7 @@ "node" ], "dependencies": { - "entryjs": "https://github.com/entrylabs/entryjs.git#1.3.1", + "entryjs": "https://github.com/entrylabs/entryjs.git#master", "entry-hw": "https://github.com/entrylabs/entry-hw.git#master", "jquery": "~1.11.3", "jquery-ui": "~1.11.x", diff --git a/app/src/native_controll.js b/app/src/native_controll.js index 9c8063053..75e00c0c9 100644 --- a/app/src/native_controll.js +++ b/app/src/native_controll.js @@ -361,8 +361,14 @@ Entry.plugin = (function () { if(!isNotFirst) { var isTempRecovery = false; + var isExistFolder; + var tempProject = path.join(__dirname, 'temp'); - if(localStorage.hasOwnProperty('tempProject')) { + if( fs.existsSync(tempProject) ) { + isExistFolder = fs.readdirSync(tempProject).length > 0; + } + + if(localStorage.hasOwnProperty('tempProject') && isExistFolder) { isTempRecovery = confirm(Lang.Workspace.restore_project_msg); } @@ -372,7 +378,6 @@ Entry.plugin = (function () { }); } else { var jsonObj = JSON.parse(localStorage.getItem('tempProject')); - jsonObj.path = load_path; localStorage.setItem('nativeLoadProject', JSON.stringify(jsonObj)); if($.isFunction(cb)) { cb(); @@ -386,7 +391,7 @@ Entry.plugin = (function () { Entry.dispatchEvent('showLoadingPopup'); try{ var load_path = options.path; - var parser = path.parse(filePath); + var parser = path.parse(load_path); localStorage.setItem('defaultPath', parser.dir); that.loadProject(load_path, function (data) {