Pepguy commited on
Commit
fde8995
·
verified ·
1 Parent(s): bdadcc3

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +2 -0
app.js CHANGED
@@ -98,7 +98,9 @@ wss.on('connection', ws => {
98
  ws.on('close', () => {
99
  if (currentRoom && rooms.has(currentRoom)) {
100
  rooms.get(currentRoom).delete(ws);
 
101
  }
 
102
  console.log("room close")
103
  });
104
  });
 
98
  ws.on('close', () => {
99
  if (currentRoom && rooms.has(currentRoom)) {
100
  rooms.get(currentRoom).delete(ws);
101
+
102
  }
103
+ currentRoom = null;
104
  console.log("room close")
105
  });
106
  });