mirror of https://github.com/BTCPrivate/copay.git
optimize address page and refresh UI calls.
This commit is contained in:
parent
710b2f48e3
commit
8836bdf86a
|
@ -44,8 +44,8 @@ angular.module('copay.header').controller('HeaderController',
|
|||
|
||||
$scope.refresh = function() {
|
||||
var w = $rootScope.wallet;
|
||||
w.connectToAll();
|
||||
controllerUtils.updateBalance(function() {
|
||||
w.connectToAll();
|
||||
$rootScope.$digest();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -56,7 +56,6 @@ Wallet.prototype.connectToAll = function() {
|
|||
this.sendWalletReady(this.firstCopayerId);
|
||||
this.firstCopayerId = null;
|
||||
}
|
||||
this.emit('refresh');
|
||||
};
|
||||
|
||||
Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) {
|
||||
|
@ -206,8 +205,9 @@ Wallet.prototype.netStart = function() {
|
|||
}
|
||||
|
||||
net.start(startOpts, function() {
|
||||
self.emit('created', net.getPeer());
|
||||
self.connectToAll();
|
||||
self.emit('created', net.getPeer());
|
||||
self.emit('refresh');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -59,14 +59,12 @@ angular.module('copay.controllerUtils')
|
|||
$location.path('addresses');
|
||||
});
|
||||
w.on('refresh', function() {
|
||||
alert('refresh');
|
||||
root.updateBalance(function() {
|
||||
$rootScope.$digest();
|
||||
});
|
||||
$rootScope.$digest();
|
||||
});
|
||||
w.on('publicKeyRingUpdated', function() {
|
||||
alert('pkr updated');
|
||||
root.updateBalance(function() {
|
||||
$rootScope.$digest();
|
||||
});
|
||||
|
@ -80,7 +78,6 @@ angular.module('copay.controllerUtils')
|
|||
};
|
||||
|
||||
root.updateBalance = function(cb) {
|
||||
alert('update balance');
|
||||
root.setSocketHandlers();
|
||||
$rootScope.balanceByAddr = {};
|
||||
var w = $rootScope.wallet;
|
||||
|
|
Loading…
Reference in New Issue