From 57083d119a730deb3fa4b7e26ce57e1c23f8cb21 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 12 Nov 2014 14:18:19 -0300 Subject: [PATCH] fix moreController (updating balance) --- js/controllers/more.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/controllers/more.js b/js/controllers/more.js index 286cc1f44..7d57c7a89 100644 --- a/js/controllers/more.js +++ b/js/controllers/more.js @@ -67,6 +67,7 @@ angular.module('copayApp.controllers').controller('MoreController', }, 1); $scope.save = function() { + var w = $rootScope.wallet; w.changeSettings({ unitName: $scope.selectedUnit.shortName, unitToSatoshi: $scope.selectedUnit.value, @@ -75,18 +76,23 @@ angular.module('copayApp.controllers').controller('MoreController', alternativeIsoCode: $scope.selectedAlternative.isoCode, }); notification.success('Success', $filter('translate')('settings successfully updated')); - controllerUtils.updateBalance(); + controllerUtils.updateBalance(w, function() { + $rootScope.$digest(); + }); }; $scope.purge = function(deleteAll) { var removed = w.purgeTxProposals(deleteAll); if (removed) { - controllerUtils.updateBalance(); + controllerUtils.updateBalance(w, function() { + $rootScope.$digest(); + }); } notification.info('Transactions Proposals Purged', removed + ' ' + $filter('translate')('transaction proposal purged')); }; $scope.updateIndexes = function() { + var w = $rootScope.wallet; notification.info('Scaning for transactions', 'Using derived addresses from your wallet'); w.updateIndexes(function(err) { notification.info('Scan Ended', 'Updating balance'); @@ -94,9 +100,10 @@ angular.module('copayApp.controllers').controller('MoreController', notification.error('Error', $filter('translate')('Error updating indexes: ') + err); } controllerUtils.updateAddressList(); - controllerUtils.updateBalance(function() { + controllerUtils.updateBalance(w, function() { notification.info('Finished', 'The balance is updated using the derived addresses'); w.sendIndexes(); + $rootScope.$digest(); }); }); };