Merge pull request #1756 from cmgustavo/feature/manage-wallets

Manage wallets
This commit is contained in:
Ivan Socolsky 2014-11-11 13:02:43 -03:00
commit 1753e315c1
8 changed files with 94 additions and 21 deletions

View file

@ -359,13 +359,12 @@ angular.module('copayApp.services')
$rootScope.pendingTxCount = res.pendingForUs;
};
root.deleteWallet = function($scope, w) {
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('Wallet deleted', $filter('translate')('Wallet deleted'));
$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();
});
};