We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f3d37b commit 4a7a0aaCopy full SHA for 4a7a0aa
server/server.ts
@@ -94,16 +94,14 @@ const io = new Server(httpServer, {
94
origin: ['http://localhost:5656', 'http://localhost:8080', API_BASE_URL]
95
}
96
});
97
+
98
//creating map for user list
99
const userList = {};
100
io.on('connection', (client) => {
101
client.on('custom-event', (redux_store, room) => {
102
if (room) {
103
//sending to sender client, only if they are in room
104
client.to(room).emit('receive message', redux_store);
- } else {
105
- //send to all connected clients except the one that sent the message
106
- client.broadcast.emit('receive message', redux_store);
107
108
109
0 commit comments