Skip to content

Commit

Permalink
[backend] Fix error in ChatGateway emit
Browse files Browse the repository at this point in the history
  • Loading branch information
kotto5 committed Jan 23, 2024
1 parent 3de90b4 commit a6f50e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/src/chat/chat.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export class ChatGateway {
this.chatService.getInvite(data.userId) !==
this.chatService.getUserId(client)
) {
client.emit('error-pong', 'No pending invite found.');
this.server
.to(client.id)
.emit('error-pong', 'No pending invite found.');
return;
}
const emitData = { roomId: v4() };
Expand Down
2 changes: 1 addition & 1 deletion backend/test/chat-gateway.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ describe('ChatGateway and ChatController (e2e)', () => {

emitter.ws.on('match-pong', mockCallback1);
errorCtx = new Promise<any>((resolve) =>
listener.ws.on('error-pong', (data) => resolve(data)),
emitter.ws.on('error-pong', (data) => resolve(data)),
);
listener.ws.on('match-pong', mockCallback2);

Expand Down

0 comments on commit a6f50e7

Please sign in to comment.