Merge pull request #6581 from cmgustavo/bug/coinbase-03

Purchase throught Coinbase: Force buyInfo request until get tran…
This commit is contained in:
Matias Alejo Garcia 2017-08-17 15:00:57 +02:00 committed by GitHub
commit 548c4e3465

View file

@ -209,12 +209,7 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
});
};
$timeout(function() {
var tx = b.data ? b.data.transaction : null;
if (tx) {
processBuyTx(tx);
}
else {
var _processBuyOrder = function() {
coinbaseService.getBuyOrder(accessToken, accountId, b.data.id, function (err, buyResp) {
if (err) {
ongoingProcess.set('buyingBitcoin', false, statusChangeHandler);
@ -222,9 +217,24 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
return;
}
var tx = buyResp.data ? buyResp.data.transaction : null;
if (tx && tx.id) {
processBuyTx(tx);
} else {
$timeout(function() {
_processBuyOrder();
}, 5000);
}
});
}
$timeout(function() {
var tx = b.data ? b.data.transaction : null;
if (tx && tx.id) {
processBuyTx(tx);
}
else {
_processBuyOrder();
}
}, 8000);
});
});