From f8226dde22e1a8ebe3b47750b5e637d829164f0e Mon Sep 17 00:00:00 2001 From: Pheuw1 Date: Thu, 16 Mar 2023 14:21:48 +0100 Subject: [PATCH] nest socket disconnect --- back/volume/src/chat/chat.gateway.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/back/volume/src/chat/chat.gateway.ts b/back/volume/src/chat/chat.gateway.ts index f1263cc..0b2d638 100644 --- a/back/volume/src/chat/chat.gateway.ts +++ b/back/volume/src/chat/chat.gateway.ts @@ -37,11 +37,7 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { async handleConnection (socket: Socket): Promise {} async handleDisconnect (socket: Socket): Promise { - const user = await this.connectedUserRepository.findOneBy({ - socket: socket.id - }) - if (user !== null) await this.connectedUserRepository.remove(user) - socket.disconnect() + await this.onLeaveChannel(socket) } @SubscribeMessage('joinChannel')