disconnect working

This commit is contained in:
Manuel Araoz 2014-05-09 14:44:05 -03:00
commit 1b87083579
3 changed files with 8 additions and 4 deletions

View file

@ -134,7 +134,8 @@ Wallet.prototype._handleConnect = function(newCopayerId) {
this.emit('connect', peerID);
};
Wallet.prototype._handleDisconnect = function(copayerID) {
Wallet.prototype._handleDisconnect = function(peerID) {
this.emit('disconnect', peerID);
};
Wallet.prototype._optsToObj = function() {

View file

@ -115,9 +115,9 @@ Network.prototype._deletePeer = function(peerId) {
this.connectedPeers = Network._arrayRemove(peerId, this.connectedPeers);
};
Network.prototype._onClose = function(peerId) {
this._deletePeer(peerId);
this.emit('disconnect');
Network.prototype._onClose = function(peerID) {
this._deletePeer(peerID);
this.emit('disconnect', peerID);
};
Network.prototype.connectToCopayers = function(copayerIds) {

View file

@ -96,6 +96,9 @@ angular.module('copay.controllerUtils')
}
$rootScope.$digest();
});
w.on('disconnect', function(peerID) {
$rootScope.$digest();
});
w.on('close', root.onErrorDigest);
w.netStart();
};