mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Handle then
s that return a promise
This commit is contained in:
parent
5caf80e9a2
commit
4784f0d96b
@ -35,7 +35,13 @@ function lodashAsPromised($q) {
|
||||
}
|
||||
|
||||
function _then(promise, fn) {
|
||||
return promise.then(fn);
|
||||
return promise.then(function(value) {
|
||||
if (_.isFunction(value.then)) {
|
||||
return _then(value, fn);
|
||||
} else {
|
||||
return fn(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function _catch(promise, fn) {
|
||||
|
Loading…
Reference in New Issue
Block a user