Browse Source

missed in previous commit

master
nicolas-arnaud 2 years ago
parent
commit
cf19f236ad
  1. 1
      back/volume/src/chat/chat.controller.ts
  2. 1
      front/volume/src/App.svelte
  3. 6
      front/volume/src/components/Chat.svelte

1
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()

1
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 {

6
front/volume/src/components/Chat.svelte

@ -43,6 +43,12 @@
messages = [...messages, msg];
});
socket.on("messages", (msgs: Array<chatMessagesType>) => {
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")

Loading…
Cancel
Save