Handle error in the review screen
This commit is contained in:
parent
82c0746ff8
commit
4c9ff1b28b
1 changed files with 18 additions and 6 deletions
|
|
@ -116,7 +116,9 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
if (!tx || !vm.originWallet) return;
|
if (!tx || !vm.originWallet) return;
|
||||||
|
|
||||||
if (vm.paymentExpired) {
|
if (vm.paymentExpired) {
|
||||||
popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.'));
|
popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.', function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
}));
|
||||||
vm.sendStatus = '';
|
vm.sendStatus = '';
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
|
|
@ -486,20 +488,26 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
walletService.getAddress(vm.originWallet, false, function onReturnWalletAddress(err, returnAddr) {
|
walletService.getAddress(vm.originWallet, false, function onReturnWalletAddress(err, returnAddr) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.set('connectingShapeshift', false);
|
ongoingProcess.set('connectingShapeshift', false);
|
||||||
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString());
|
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString(), function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
walletService.getAddress(toWallet, false, function onWithdrawalWalletAddress(err, withdrawalAddr) {
|
walletService.getAddress(toWallet, false, function onWithdrawalWalletAddress(err, withdrawalAddr) {
|
||||||
if (err) {
|
if (err) {
|
||||||
ongoingProcess.set('connectingShapeshift', false);
|
ongoingProcess.set('connectingShapeshift', false);
|
||||||
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString());
|
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString(), function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
shapeshiftService.shiftIt(vm.originWallet.coin, toWallet.coin, withdrawalAddr, returnAddr, function onShiftIt(err, shapeshiftData) {
|
shapeshiftService.shiftIt(vm.originWallet.coin, toWallet.coin, withdrawalAddr, returnAddr, function onShiftIt(err, shapeshiftData) {
|
||||||
if (err && err != null) {
|
if (err && err != null) {
|
||||||
ongoingProcess.set('connectingShapeshift', false);
|
ongoingProcess.set('connectingShapeshift', false);
|
||||||
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString());
|
popupService.showAlert(gettextCatalog.getString('Shapeshift Error'), err.toString(), function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
vm.memo = 'ShapeShift Order:\nhttps://www.shapeshift.io/#/status/' + shapeshiftData.orderId;
|
vm.memo = 'ShapeShift Order:\nhttps://www.shapeshift.io/#/status/' + shapeshiftData.orderId;
|
||||||
vm.memoExpanded = !!vm.memo;
|
vm.memoExpanded = !!vm.memo;
|
||||||
|
|
@ -640,7 +648,9 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
popupService.showAlert(gettextCatalog.getString('Error at confirm'), bwcError.msg(msg));
|
popupService.showAlert(gettextCatalog.getString('Error at confirm'), bwcError.msg(msg), function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function setupTx(tx) {
|
function setupTx(tx) {
|
||||||
|
|
@ -825,7 +835,9 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
if (tx.sendMax && sendMaxInfo.amount == 0) {
|
if (tx.sendMax && sendMaxInfo.amount == 0) {
|
||||||
ongoingProcess.set('calculatingFee', false);
|
ongoingProcess.set('calculatingFee', false);
|
||||||
setNotReady(gettextCatalog.getString('Insufficient confirmed funds'));
|
setNotReady(gettextCatalog.getString('Insufficient confirmed funds'));
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Not enough funds for fee'));
|
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Not enough funds for fee'), function () {
|
||||||
|
$ionicHistory.goBack();
|
||||||
|
});
|
||||||
return cb('no_funds');
|
return cb('no_funds');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue