Skip to content

Commit

Permalink
Fix issue with disconnecting listener.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasmolnar committed Aug 10, 2023
1 parent 0718ec5 commit 9517936
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ try {

socket.on("disconnecting", async () => {
socketDebug(`${socket.id} has disconnected`);
for (const roomID in socket.rooms) {
for (const roomID of Array.from(socket.rooms)) {
const otherClients = (await io.in(roomID).fetchSockets()).filter(
(_socket) => _socket.id !== socket.id,
);
Expand Down

0 comments on commit 9517936

Please sign in to comment.