Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
notskamr committed Nov 28, 2024
1 parent dbbc3ec commit 7bb78c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/scripts/cabin/cabin.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ window.onbeforeunload = disconnect;
function disconnect() {
if (peer.close)
peer.close();
socket.emit('disconnect');
socket.emit('leave-cabin');
}

window.onresize = calculateGrid;
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ io.on('connection', socket => {
console.log(data);
});

socket.on('disconnect', () => {
socket.on('leave-cabin', () => {
console.log(`${username} (${userId}) disconnected from '${cabinAddress}'`);
socket.to(cabinAddress).emit('user-disconnected', userId, username);
socket.disconnect(true);
Expand Down

0 comments on commit 7bb78c6

Please sign in to comment.