1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Handle thens that return a promise

This commit is contained in:
Joe Fiorini 2015-05-29 13:46:19 -04:00
parent 5caf80e9a2
commit 4784f0d96b

View File

@ -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) {