Skip to content

Commit 4a7a0aa

Browse files
committed
so far 2
1 parent 1f3d37b commit 4a7a0aa

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

server/server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,14 @@ const io = new Server(httpServer, {
9494
origin: ['http://localhost:5656', 'http://localhost:8080', API_BASE_URL]
9595
}
9696
});
97+
9798
//creating map for user list
9899
const userList = {};
99100
io.on('connection', (client) => {
100101
client.on('custom-event', (redux_store, room) => {
101102
if (room) {
102103
//sending to sender client, only if they are in room
103104
client.to(room).emit('receive message', redux_store);
104-
} else {
105-
//send to all connected clients except the one that sent the message
106-
client.broadcast.emit('receive message', redux_store);
107105
}
108106
});
109107

0 commit comments

Comments
 (0)