fix(files) getConfig promise: add reject

This commit is contained in:
coderaiser 2015-07-08 05:26:49 -04:00
parent 2b307fe6dd
commit da80935798

View file

@ -119,9 +119,14 @@
RESTful = DOM.RESTful;
if (!Promises.config)
Promises.config = new Promise(function(resolve) {
Promises.config = new Promise(function(resolve, reject) {
is = true;
RESTful.Config.read(resolve);
RESTful.Config.read(function(error, data) {
if (error)
reject(error);
else
resolve(data);
});
});
Promises.config.then(function(data) {
@ -134,6 +139,9 @@
if (!is)
Promises.config = null;
});
}, function() {
if (!is)
Promises.config = null;
});
}