mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 13:57:39 -02:30
Handle thens that return a promise
This commit is contained in:
@@ -35,7 +35,13 @@ function lodashAsPromised($q) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _then(promise, fn) {
|
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) {
|
function _catch(promise, fn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user