Improve the error handling to expose and log errors if removing a card fails.

This commit is contained in:
Andy Phillipson 2016-11-21 15:10:59 -05:00
commit 1a2fea578d
4 changed files with 22 additions and 5 deletions

View file

@ -11,7 +11,11 @@ angular.module('copayApp.controllers').controller('preferencesBitpayCardControll
};
var remove = function(card) {
bitpayCardService.remove(card, function() {
bitpayCardService.remove(card, function(err) {
if (err) {
$scope.error = gettextCatalog.getString('Could not remove card');
return;
}
$ionicHistory.clearHistory();
$timeout(function() {
$state.go('tabs.home');