compute balance for all wallets

This commit is contained in:
Ivan Socolsky 2014-10-20 10:29:43 -03:00 committed by Matias Alejo Garcia
commit 1f45ecfdc8
3 changed files with 78 additions and 52 deletions

View file

@ -81,7 +81,18 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
$scope.walletSelection = false;
controllerUtils.setFocusedWallet(wid);
};
$scope.toggleWalletSelection = function() {
$scope.walletSelection = !$scope.walletSelection;
$scope.wallets = [];
var wids = _.pluck($rootScope.iden.listWallets(), 'id');
_.each(wids, function(wid) {
if (controllerUtils.isFocusedWallet(wid)) return;
var w = $rootScope.iden.getOpenWallet(wid);
$scope.wallets.push(w);
controllerUtils.updateBalance(w, function(err, res) {
if (err) return;
});
});
};
});