From ab70a50554f6f9e3a43a05a8bd7c442d734e9768 Mon Sep 17 00:00:00 2001 From: vvandenb Date: Mon, 20 Mar 2023 17:05:45 +0100 Subject: [PATCH] * Last fix --- back/volume/src/chat/chat.controller.ts | 3 +-- back/volume/src/chat/chat.gateway.ts | 1 - front/volume/src/App.svelte | 3 ++- front/volume/src/components/Channels.svelte | 3 ++- front/volume/src/components/NavBar.svelte | 3 ++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/back/volume/src/chat/chat.controller.ts b/back/volume/src/chat/chat.controller.ts index 3c7b536..d7b1031 100644 --- a/back/volume/src/chat/chat.controller.ts +++ b/back/volume/src/chat/chat.controller.ts @@ -62,7 +62,7 @@ export class ChatController { ): Promise { const channel = await this.channelService.getFullChannel(id) const user: User | null = await this.usersService.getFullUser(target.id) - if (user == null) { + if (user == null || target === undefined) { throw new NotFoundException(`User #${target.id} not found`) } if (!(await this.channelService.isUser(channel.id, +profile.id))) { @@ -76,7 +76,6 @@ export class ChatController { if (await this.channelService.isBanned(channel.id, target.id)) { throw new BadRequestException('User is banned from this channel') } - user.socketKey = '' channel.users.push(user) await this.channelService.save(channel) } diff --git a/back/volume/src/chat/chat.gateway.ts b/back/volume/src/chat/chat.gateway.ts index 117dc71..f6ced76 100644 --- a/back/volume/src/chat/chat.gateway.ts +++ b/back/volume/src/chat/chat.gateway.ts @@ -56,7 +56,6 @@ export class ChatGateway implements OnGatewayConnection, OnGatewayDisconnect { @SubscribeMessage('joinChannel') async onJoinChannel(socket: Socket, connect: ConnectionDto): Promise { await this.connectedUserRepository.delete({ user: connect.UserId }) - const channel = await this.chatService.getFullChannel(connect.ChannelId); if (channel.banned.findIndex((ban) => +ban[0] === +connect.UserId) !== -1) { this.server diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index c8f30ad..2d7a36a 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -169,7 +169,6 @@ {:else if $store.twoFA === true && $store.isVerified === false}

{:else} - + {#if appState.includes(`${APPSTATE.CHANNELS}#`)} {#key appState}
{}; export let clickLeaderboard = () => {}; export let failedGameLogIn: boolean; + export let gamePlaying: boolean; let hide = true; @@ -28,7 +29,7 @@ } -