Skip to content

Commit

Permalink
fix: socket push conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Oct 25, 2023
1 parent 8eae75f commit 887fef3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ class SocketServer extends EventEmitter {
if (!this.sockets.has(socket.id)) {
this.sockets.set(socket.id, socket);
this.clients.get(socket.clientId).push(socket);
organization.clients[socket.clientId].push(socket)
if (!organization.clients[socket.clientId])
organization.clients[socket.clientId] = [socket]
else
organization.clients[socket.clientId].push(socket)
}

if (socket.user_id) {
Expand Down

0 comments on commit 887fef3

Please sign in to comment.