Skip to content

Commit

Permalink
fix: clearTimout if userid seesion is reconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Apr 24, 2024
1 parent 63f9d53 commit 4895fff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ class SocketServer extends EventEmitter {
let user = this.users.get(socket.user_id)

if (!user) {
clearTimeout(user)
this.users.set(socket.user_id, { [socket.id]: socket })
} else
} else {
clearTimeout(user)
user[socket.id] = socket
}
}

}
Expand Down

0 comments on commit 4895fff

Please sign in to comment.