mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 06:34:21 +00:00
socket-events: fix join
This commit is contained in:
parent
7287c6bcaa
commit
50037644c0
1 changed files with 4 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue