Merge pull request #1756 from cmgustavo/feature/manage-wallets
Manage wallets
This commit is contained in:
commit
1753e315c1
8 changed files with 94 additions and 21 deletions
|
|
@ -12,4 +12,25 @@ angular.module('copayApp.controllers').controller('ManageController', function($
|
|||
$scope.backupPlainText = backupService.profileEncrypted($rootScope.iden);
|
||||
$scope.hideViewBackup = true;
|
||||
};
|
||||
|
||||
$scope.getWallets = function() {
|
||||
$scope.wallets = [];
|
||||
var wids = _.pluck($rootScope.iden.listWallets(), 'id');
|
||||
_.each(wids, function(wid) {
|
||||
var w = $rootScope.iden.getWalletById(wid);
|
||||
$scope.wallets.push(w);
|
||||
controllerUtils.updateBalance(w, function() {
|
||||
$rootScope.$digest();
|
||||
}, true);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.deleteWallet = function(w) {
|
||||
if (!w) return;
|
||||
$scope.loading = w.id;
|
||||
controllerUtils.deleteWallet($scope, w, function() {
|
||||
$scope.loading = false;
|
||||
$scope.getWallets();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -88,7 +88,13 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
};
|
||||
|
||||
$scope.deleteWallet = function() {
|
||||
controllerUtils.deleteWallet($scope);
|
||||
$scope.loading = true;
|
||||
controllerUtils.deleteWallet($scope, $rootScope.wallet, function() {
|
||||
$rootScope.wallet = null;
|
||||
var lastFocused = $rootScope.iden.getLastFocusedWallet();
|
||||
controllerUtils.bindProfile($scope, $rootScope.iden, lastFocused);
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.purge = function(deleteAll) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue