fix: for..of in disconnecting event
This commit is contained in:
parent
49bf529ea1
commit
1ed0fe035a
@ -80,9 +80,11 @@ try {
|
||||
|
||||
socket.on("disconnecting", async () => {
|
||||
socketDebug(`${socket.id} has disconnected`);
|
||||
for (const roomID in socket.rooms) {
|
||||
for (const roomID of socket.rooms) {
|
||||
const otherClients = (await io.in(roomID).fetchSockets()).filter(
|
||||
(_socket) => _socket.id !== socket.id,
|
||||
(_socket) => {
|
||||
return _socket.id !== socket.id;
|
||||
},
|
||||
);
|
||||
|
||||
if (otherClients.length > 0) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es2020",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user