diff --git a/client/js/chan.ts b/client/js/chan.ts index 767e3f0c..2cf2d621 100644 --- a/client/js/chan.ts +++ b/client/js/chan.ts @@ -20,6 +20,7 @@ export function toClientChan(shared: SharedNetworkChan): ClientChan { inputHistoryPosition: 0, historyLoading: false, scrolledToBottom: true, + users: [], usersOutdated: shared.type === "channel" ? true : false, moreHistoryAvailable: shared.totalMessages > shared.messages.length, inputHistory: history, diff --git a/client/js/socket-events/network.ts b/client/js/socket-events/network.ts index d5ad57ee..6c22a3f7 100644 --- a/client/js/socket-events/network.ts +++ b/client/js/socket-events/network.ts @@ -39,6 +39,7 @@ socket.on("network:status", function (data) { if (!data.connected) { network.channels.forEach((channel) => { + channel.users = []; // TODO: untangle this channel.state = ChanState.PARTED; }); } diff --git a/client/js/types.d.ts b/client/js/types.d.ts index 017263ff..956fc1c2 100644 --- a/client/js/types.d.ts +++ b/client/js/types.d.ts @@ -33,6 +33,8 @@ type ClientChan = Omit & { historyLoading: boolean; scrolledToBottom: boolean; usersOutdated: boolean; + + users: ClientUser[]; }; type InitClientChan = ClientChan & {