re-add 8 second magical delay, turns out it's important

This commit is contained in:
Vincent Khougaz 2017-05-31 17:16:12 -07:00
parent 34adb9ebe5
commit d7b160f9b3
1 changed files with 16 additions and 14 deletions

View File

@ -198,21 +198,23 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
});
};
var tx = b.data ? b.data.transaction : null;
if (tx) {
processBuyTx(tx);
}
else {
coinbaseService.getBuyOrder(accessToken, accountId, b.data.id, function (err, buyResp) {
if (err) {
ongoingProcess.set('buyingBitcoin', false, statusChangeHandler);
showError(err);
return;
}
var tx = buyResp.data ? buyResp.data.transaction : null;
$timeout(function() {
var tx = b.data ? b.data.transaction : null;
if (tx) {
processBuyTx(tx);
});
}
}
else {
coinbaseService.getBuyOrder(accessToken, accountId, b.data.id, function (err, buyResp) {
if (err) {
ongoingProcess.set('buyingBitcoin', false, statusChangeHandler);
showError(err);
return;
}
var tx = buyResp.data ? buyResp.data.transaction : null;
processBuyTx(tx);
});
}
}, 8000);
});
});
});