login optimized

This commit is contained in:
Manuel Araoz 2014-05-06 17:09:35 -03:00
parent 20b0b6e9c7
commit 710b2f48e3
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,6 @@ angular.module('copay.header').controller('HeaderController',
$rootScope.$watch('wallet', function(wallet) {
if (wallet) {
controllerUtils.setSocketHandlers();
}
});

View File

@ -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;