Spaces:
Sleeping
Sleeping
Update app.js
Browse files
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 |
});
|