From 8ce4d0621e8c512a4618b3f279ad871b036a8563 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Apr 2015 02:31:31 -0400 Subject: [PATCH] fix(files) config read only once and do not sync with server even when server reloads --- lib/client/files.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/client/files.js b/lib/client/files.js index cf39116b..619cbb7b 100644 --- a/lib/client/files.js +++ b/lib/client/files.js @@ -140,16 +140,13 @@ function getConfig(callback) { var RESTful = DOM.RESTful; - if (!Promises.config) - Promises.config = new Promise(function(resolve) { - RESTful.Config.read(resolve); - }); + Promises.config = new Promise(function(resolve) { + RESTful.Config.read(resolve); + }); Promises.config.then(function(data) { - if (!Data.config) { - Data.config = data; - Storage.setAllowed(data.localStorage); - } + Data.config = data; + setConfig(data); callback(null, data); });