From ae547ccd2305ec4c77e09c3c9ad6f07d8e2141ca Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 21 Aug 2015 05:15:29 -0400 Subject: [PATCH] fix(dom) getCurrentData: when could not get hash call callback with error --- lib/client/dom.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index f4fbc556..c1735599 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -758,13 +758,15 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; RESTful.read(path, func); } else { DOM.checkStorageHash(path, function(error, equal, hashNew) { - Util.exec.if(!error && equal, function() { - DOM.getDataFromStorage(path, callback); - }, function() { - hash = hashNew; - RESTful.read(path, func); - }); - }); + if (error) { + callback(error); + } else if (equal) { + DOM.getDataFromStorage(path, callback); + } else { + hash = hashNew; + RESTful.read(path, func); + } + }); } };