mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-04 14:52:19 +02:00
socket-events: fix network:status
This commit is contained in:
parent
fe4f497fad
commit
3ea5170e6a
|
@ -3,6 +3,7 @@ import {store} from "../store";
|
||||||
import {switchToChannel} from "../router";
|
import {switchToChannel} from "../router";
|
||||||
import {toClientChan} from "../chan";
|
import {toClientChan} from "../chan";
|
||||||
import {ClientNetwork} from "../types";
|
import {ClientNetwork} from "../types";
|
||||||
|
import {ChanState} from "../../../shared/types/chan";
|
||||||
|
|
||||||
socket.on("network", function (data) {
|
socket.on("network", function (data) {
|
||||||
const network: ClientNetwork = {
|
const network: ClientNetwork = {
|
||||||
|
@ -38,8 +39,7 @@ socket.on("network:status", function (data) {
|
||||||
|
|
||||||
if (!data.connected) {
|
if (!data.connected) {
|
||||||
network.channels.forEach((channel) => {
|
network.channels.forEach((channel) => {
|
||||||
channel.users = [];
|
channel.state = ChanState.PARTED;
|
||||||
channel.state = 0;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue