fix(files) config read only once and do not sync with server even when server reloads

This commit is contained in:
coderaiser 2015-04-15 02:31:31 -04:00
parent efc0479d25
commit 8ce4d0621e

View file

@ -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);
});