diff --git a/src/chat/chat.gateway.ts b/src/chat/chat.gateway.ts index af5648d..bb2fcba 100644 --- a/src/chat/chat.gateway.ts +++ b/src/chat/chat.gateway.ts @@ -147,12 +147,12 @@ export class ChatGateway @MessageBody() roomId: string, ) { this.chatService.leaveChatRoom(client.data.userId, roomId); - client.leave(roomId); - this.server + await this.server .to(roomId) .emit('leave_room', { roomId: roomId, userId: client.data.userId }); - this.server + await this.server .to(`${roomId}_list`) .emit('leave_room', { roomId: roomId, userId: client.data.userId }); + client.leave(roomId); } }