fix socket-event: network

This commit is contained in:
Reto Brunner 2024-04-07 17:45:44 +02:00
parent c20cd6bda1
commit fe4f497fad

View file

@ -1,13 +1,16 @@
import socket from "../socket";
import {store} from "../store";
import {switchToChannel} from "../router";
import {toClientChan} from "../chan";
import {ClientNetwork} from "../types";
socket.on("network", function (data) {
const network = data.network;
network.isJoinChannelShown = false;
network.isCollapsed = false;
network.channels.forEach(store.getters.initChannel);
const network: ClientNetwork = {
...data.network,
channels: data.network.channels.map(toClientChan),
isJoinChannelShown: false,
isCollapsed: false,
};
store.commit("networks", [...store.state.networks, network]);