From 60a8503e76f6d951528dcb2b90fd895be96a8ac4 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 16 Jul 2015 06:45:35 -0400 Subject: [PATCH] fix(client) destroy file view even if we can not read directory --- lib/client.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/client.js b/lib/client.js index 78640479..357f383d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -372,17 +372,20 @@ var Util, DOM, CloudFunc, join; createFileTable(obj, panel, options, callback); else RESTful.read(path, 'json', function(error, obj) { - createFileTable(obj, panel, options, function() { - var current; + if (!error) { + Storage.set(path, obj); - if (isRefresh && !noCurrent) { - current = DOM.getCurrentByName(name); - DOM.setCurrentFile(current); - } - - Util.exec(callback); - }); - Storage.set(path, obj); + createFileTable(obj, panel, options, function() { + var current; + + if (isRefresh && !noCurrent) { + current = DOM.getCurrentByName(name); + DOM.setCurrentFile(current); + } + + Util.exec(callback); + }); + } }); };