fix(files) getConfig: remove Promise before resolve

This commit is contained in:
coderaiser 2015-07-04 10:38:14 -04:00
parent a4d292a988
commit 91b73dafce

View file

@ -115,20 +115,24 @@
}
function getConfig(callback) {
var RESTful = DOM.RESTful;
var is,
RESTful = DOM.RESTful;
if (!Promises.config)
Promises.config = new Promise(function(resolve) {
is = true;
RESTful.Config.read(resolve);
});
Promises.config.then(function(data) {
is = false;
Storage.setAllowed(data.localStorage);
callback(null, data);
timeout(function() {
Promises.config = null;
if (!is)
Promises.config = null;
});
});
}