From f603de903038a45ac95094276ec17c97509e47aa Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 23 Jan 2017 17:29:37 +0200 Subject: [PATCH] chore(client) ajaxLoad: add early return --- client/client.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/client/client.js b/client/client.js index 8cfdf591..3b9c7de1 100644 --- a/client/client.js +++ b/client/client.js @@ -404,21 +404,22 @@ var Util, DOM, CloudFunc, join; noCurrent = options.noCurrent; if (!isRefresh && json) - createFileTable(obj, panel, options, callback); - else - RESTful.read(path, 'json', function(error, obj) { - if (!error) { - Storage.set(path, obj); - - createFileTable(obj, panel, options, function() { - if (isRefresh && !noCurrent) { - DOM.setCurrentByName(name); - } - - Util.exec(callback); - }); + return createFileTable(obj, panel, options, callback); + + RESTful.read(path, 'json', function(error, obj) { + if (error) + return; + + Storage.set(path, obj); + + createFileTable(obj, panel, options, function() { + if (isRefresh && !noCurrent) { + DOM.setCurrentByName(name); } + + Util.exec(callback); }); + }); }; if (!options)