Delete wallet function as service

This commit is contained in:
Gustavo Maximiliano Cortez 2014-10-21 14:26:58 -03:00 committed by Matias Alejo Garcia
commit c01cdb8b25
5 changed files with 29 additions and 19 deletions

View file

@ -388,6 +388,16 @@ angular.module('copayApp.services')
$rootScope.pendingTxCount = pendingForUs;
};
root.deleteWallet = function($scope, w) {
w = w || $rootScope.wallet;
$rootScope.iden.deleteWallet(w.id, function() {
notification.info('Wallet deleted', $filter('translate')('Wallet deleted'));
$rootScope.wallet = null;
var lastFocused = $rootScope.iden.profile.getLastFocusedWallet();
root.bindProfile($scope, $rootScope.iden, lastFocused);
});
};
function getActionList(actions) {
var peers = Object.keys(actions).map(function(i) {
return {