socket-events: fix network:status

This commit is contained in:
Reto Brunner 2024-04-07 17:51:25 +02:00
parent fe4f497fad
commit 3ea5170e6a

View file

@ -3,6 +3,7 @@ import {store} from "../store";
import {switchToChannel} from "../router";
import {toClientChan} from "../chan";
import {ClientNetwork} from "../types";
import {ChanState} from "../../../shared/types/chan";
socket.on("network", function (data) {
const network: ClientNetwork = {
@ -38,8 +39,7 @@ socket.on("network:status", function (data) {
if (!data.connected) {
network.channels.forEach((channel) => {
channel.users = [];
channel.state = 0;
channel.state = ChanState.PARTED;
});
}
});