diff --git a/js/controllers/header.js b/js/controllers/header.js index 1c0dc56e9..93f77bfbe 100644 --- a/js/controllers/header.js +++ b/js/controllers/header.js @@ -23,7 +23,6 @@ angular.module('copay.header').controller('HeaderController', $rootScope.$watch('wallet', function(wallet) { if (wallet) { - controllerUtils.setSocketHandlers(); } }); diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 70e5960b2..edf5152c1 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -59,14 +59,17 @@ angular.module('copay.controllerUtils') $location.path('addresses'); }); w.on('refresh', function() { - root.setSocketHandlers(); + alert('refresh'); root.updateBalance(function() { $rootScope.$digest(); }); $rootScope.$digest(); }); w.on('publicKeyRingUpdated', function() { - root.setSocketHandlers(); + alert('pkr updated'); + root.updateBalance(function() { + $rootScope.$digest(); + }); }); w.on('openError', root.onErrorDigest); w.on('peer', function(peerID) { @@ -77,6 +80,7 @@ angular.module('copay.controllerUtils') }; root.updateBalance = function(cb) { + alert('update balance'); root.setSocketHandlers(); $rootScope.balanceByAddr = {}; var w = $rootScope.wallet;