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')