From 50037644c0a3e4d032d5fb0ab94b5cf32a0c5c2a Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 13 Apr 2024 22:02:04 +0200 Subject: [PATCH] socket-events: fix join --- client/js/socket-events/join.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/js/socket-events/join.ts b/client/js/socket-events/join.ts index 9f4539c0..02f36a59 100644 --- a/client/js/socket-events/join.ts +++ b/client/js/socket-events/join.ts @@ -1,17 +1,18 @@ import socket from "../socket"; import {store} from "../store"; import {switchToChannel} from "../router"; +import {ClientChan} from "../types"; +import {toClientChan} from "../chan"; socket.on("join", function (data) { - store.getters.initChannel(data.chan); - const network = store.getters.findNetwork(data.network); if (!network) { return; } - network.channels.splice(data.index || -1, 0, data.chan); + const clientChan: ClientChan = toClientChan(data.chan); + network.channels.splice(data.index || -1, 0, clientChan); // Queries do not automatically focus, unless the user did a whois if (data.chan.type === "query" && !data.shouldOpen) {