Cancel keep alive on join room
This commit is contained in:
parent
23e7c04393
commit
b67afca8ac
1 changed files with 2 additions and 1 deletions
|
@ -53,6 +53,7 @@ class SnapdropServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_joinRoom(peer) {
|
_joinRoom(peer) {
|
||||||
|
this._cancelKeepAlive(peer);
|
||||||
// if room doesn't exist, create it
|
// if room doesn't exist, create it
|
||||||
if (!this._rooms[peer.ip]) {
|
if (!this._rooms[peer.ip]) {
|
||||||
this._rooms[peer.ip] = {};
|
this._rooms[peer.ip] = {};
|
||||||
|
@ -84,8 +85,8 @@ class SnapdropServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_leaveRoom(peer) {
|
_leaveRoom(peer) {
|
||||||
// delete the peer
|
|
||||||
this._cancelKeepAlive(peer);
|
this._cancelKeepAlive(peer);
|
||||||
|
// delete the peer
|
||||||
if (!this._rooms[peer.ip] || !this._rooms[peer.ip][peer.id]) return;
|
if (!this._rooms[peer.ip] || !this._rooms[peer.ip][peer.id]) return;
|
||||||
|
|
||||||
delete this._rooms[peer.ip][peer.id];
|
delete this._rooms[peer.ip][peer.id];
|
||||||
|
|
Loading…
Reference in a new issue