Skip to content

Commit

Permalink
ClientChan: does need a user array after all
Browse files Browse the repository at this point in the history
  • Loading branch information
brunnre8 committed Apr 7, 2024
1 parent e91fecb commit 6f274c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/js/chan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions client/js/socket-events/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
Expand Down
2 changes: 2 additions & 0 deletions client/js/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type ClientChan = Omit<SharedChan, "messages"> & {
historyLoading: boolean;
scrolledToBottom: boolean;
usersOutdated: boolean;

users: ClientUser[];
};

type InitClientChan = ClientChan & {
Expand Down

0 comments on commit 6f274c0

Please sign in to comment.