fix notification when deleting wallet

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-09 14:37:12 -03:00
commit c122cb3488
4 changed files with 39 additions and 5 deletions

View file

@ -62,14 +62,20 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
if (!w) return;
$scope.isSafari = isMobile.Safari();
$scope.item = w;
$scope.error = null;
$scope.success = null;
$scope.deleteWallet = function() {
$scope.loading = true;
identityService.deleteWallet($scope.item, function(err) {
if (err) {
$scope.loading = null;
$scope.error = err.message;
copay.logger.warn(err);
}
$modalInstance.close();
else {
$modalInstance.close($scope.item.name || $scope.item.id);
}
});
};
@ -92,8 +98,9 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
controller: ModalInstanceCtrl
});
modalInstance.result.then(function() {
modalInstance.result.then(function(walletName) {
$scope.loading = false;
$scope.success = 'The wallet "' + walletName + '" was deleted';
$scope.setWallets();
});
};