mirror of
https://github.com/thelounge/thelounge
synced 2024-11-21 19:43:07 +00:00
fix socket-event: network
This commit is contained in:
parent
c20cd6bda1
commit
fe4f497fad
1 changed files with 8 additions and 5 deletions
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue