mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02:30
Handle thens that return a promise
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user