From cf19f236ad8d0496dfb951f9232f519437e6bc14 Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Sun, 19 Mar 2023 13:46:31 +0100 Subject: [PATCH] missed in previous commit --- back/volume/src/chat/chat.controller.ts | 1 - front/volume/src/App.svelte | 1 + front/volume/src/components/Chat.svelte | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/back/volume/src/chat/chat.controller.ts b/back/volume/src/chat/chat.controller.ts index 65e9490..b58c18d 100644 --- a/back/volume/src/chat/chat.controller.ts +++ b/back/volume/src/chat/chat.controller.ts @@ -217,7 +217,6 @@ export class ChatController { let channel = (await this.channelService.getChannel(id)) as Channel channel.password = await this.channelService.hash(data.password) this.channelService.update(channel) - } @Get() diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index 246c878..8b86fcf 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -46,6 +46,7 @@ res.json().then(async (channels) => { await formatChannelNames(channels); const channel = channels.find((c: ChannelsType) => c.name === currentChannelName); + selectedChannel = channel; if (channel) { chan.selectChat(channel.id); // disabled as it causes a bug where joining a channel happen twice } else { diff --git a/front/volume/src/components/Chat.svelte b/front/volume/src/components/Chat.svelte index 5c60021..7cd03b3 100644 --- a/front/volume/src/components/Chat.svelte +++ b/front/volume/src/components/Chat.svelte @@ -43,6 +43,12 @@ messages = [...messages, msg]; }); + + socket.on("messages", (msgs: Array) => { + messages = msgs; + console.log("You are joining channel: ", channel.name) + }); + socket.on("failedJoin", (error: string) => { show_popup(`Failed to join channel: ${error}`, false) setAppState("/channels")