mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
Handle thens 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…
x
Reference in New Issue
Block a user