ClientChan: does need a user array after all

This commit is contained in:
Reto Brunner 2024-04-07 18:04:08 +02:00
parent 3ea5170e6a
commit 29750a3e51
3 changed files with 4 additions and 0 deletions

View file

@ -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,

View file

@ -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;
});
}

View file

@ -33,6 +33,8 @@ type ClientChan = Omit<SharedChan, "messages"> & {
historyLoading: boolean;
scrolledToBottom: boolean;
usersOutdated: boolean;
users: ClientUser[];
};
type InitClientChan = ClientChan & {