deleting wallet with callback

This commit is contained in:
Gustavo Maximiliano Cortez 2014-11-11 12:54:52 -03:00
commit 74b61624e5
4 changed files with 19 additions and 10 deletions

View file

@ -359,15 +359,12 @@ angular.module('copayApp.services')
$rootScope.pendingTxCount = res.pendingForUs;
};
root.deleteWallet = function($scope, w, skipBind) {
w = w || $rootScope.wallet;
root.deleteWallet = function($scope, w, cb) {
if (!w) return root.onErrorDigest();
var name = w.getName();
$rootScope.iden.deleteWallet(w.id, function() {
notification.info(name + ' deleted', $filter('translate')('Wallet deleted'));
if (skipBind) return skipBind();
$rootScope.wallet = null;
var lastFocused = $rootScope.iden.getLastFocusedWallet();
root.bindProfile($scope, $rootScope.iden, lastFocused);
notification.info(name + ' deleted', $filter('translate')('This wallet was deleted'));
return cb();
});
};