Parcourir la source

Merge remote-tracking branch 'origin/master' into dev

# Conflicts:
#	server/index.js
RobinLinus il y a 6 ans
Parent
commit
b0fd89eb96
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      server/index.js

+ 2 - 1
server/index.js

@@ -53,6 +53,7 @@ class SnapdropServer {
     }
 
     _joinRoom(peer) {
+        this._cancelKeepAlive(peer);
         // if room doesn't exist, create it
         if (!this._rooms[peer.ip]) {
             this._rooms[peer.ip] = {};
@@ -84,8 +85,8 @@ class SnapdropServer {
     }
 
     _leaveRoom(peer) {
-        // delete the peer
         this._cancelKeepAlive(peer);
+        // delete the peer
         if (!this._rooms[peer.ip] || !this._rooms[peer.ip][peer.id]) return;
 
         delete this._rooms[peer.ip][peer.id];