Refactory get balance 's methods

This commit is contained in:
Gustavo Cortez 2014-04-17 16:42:27 -03:00
commit f55d243bed
5 changed files with 24 additions and 26 deletions

View file

@ -8,7 +8,7 @@ angular.module('copay.controllerUtils').factory('controllerUtils', function ($ro
$rootScope.wallet = w;
// Initial getBalance
$rootScope.wallet.getBalance(function(balance) {
$rootScope.wallet.getTotalBalance(function(balance) {
$rootScope.totalBalance = balance;
$rootScope.$digest();
});
@ -34,7 +34,7 @@ angular.module('copay.controllerUtils').factory('controllerUtils', function ($ro
addrs.forEach(function(addr) {
socket.on(addr, function(txid) {
console.log('Received!', txid);
$rootScope.wallet.getBalance(function(balance) {
$rootScope.wallet.getTotalBalance(function(balance) {
scope.$apply(function() {
$rootScope.totalBalance = balance;
});