mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 15:26:17 -04:00
Fix WSPeers should disconnect on 'peer-left' message, indifferent from 'disconnect' flag
This commit is contained in:
parent
07e46e472e
commit
52198c7efb
1 changed files with 16 additions and 13 deletions
|
@ -1615,8 +1615,12 @@ class PeersManager {
|
||||||
if (this._peerExists(message.peerId) && !this._webRtcSupported(message.peerId)) {
|
if (this._peerExists(message.peerId) && !this._webRtcSupported(message.peerId)) {
|
||||||
Logger.debug('WSPeer left:', message.peerId);
|
Logger.debug('WSPeer left:', message.peerId);
|
||||||
}
|
}
|
||||||
if (message.disconnect === true) {
|
else if (message.disconnect !== true) {
|
||||||
// if user actively disconnected from PairDrop server, disconnect all peer to peer connections immediately
|
// if RTCPeer and disconnect is false -> abort and wait for reconnect
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if user actively disconnected from PairDrop server or is WSPeer, disconnect all peer to peer connections immediately
|
||||||
this._disconnectOrRemoveRoomTypeByPeerId(message.peerId, message.roomType);
|
this._disconnectOrRemoveRoomTypeByPeerId(message.peerId, message.roomType);
|
||||||
|
|
||||||
// If no peers are connected anymore, we can safely assume that no other tab on the same browser is connected:
|
// If no peers are connected anymore, we can safely assume that no other tab on the same browser is connected:
|
||||||
|
@ -1630,7 +1634,6 @@ class PeersManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_onPeerConnected(peerId) {
|
_onPeerConnected(peerId) {
|
||||||
this._notifyPeerDisplayNameChanged(peerId);
|
this._notifyPeerDisplayNameChanged(peerId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue