mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(files) getConfig promise: add reject
This commit is contained in:
parent
2b307fe6dd
commit
da80935798
1 changed files with 10 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue