Skip to content

Commit

Permalink
fix(router): socket emits (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
kon14 committed Apr 3, 2022
1 parent bb53227 commit 9b88a52
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/router/src/controllers/Socket/Socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,7 @@ export class SocketController extends ConduitRouter {
if (isNil(push.receivers) || push.receivers!.length === 0) {
this.io.of(push.namespace).emit(push.event, push.data);
} else {
this.io.of(push.namespace).adapter.fetchSockets({
rooms: new Set(push.receivers)
}).then(sockets=>{
sockets.forEach(r=>{
r.to(push.receivers).emit(push.event, push.data)
})
})
this.io.of(push.namespace).to(push.receivers).emit(push.event, push.data);
}
} else {
throw new Error('Cannot join room in this context');
Expand Down

0 comments on commit 9b88a52

Please sign in to comment.