Skip to content

Commit

Permalink
Update last_read_message_id on message.read
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Aug 14, 2023
1 parent 31da90b commit b152b42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
channelState.read[event.user.id] = {
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
last_read: new Date(event.created_at),
last_read_message_id: event.last_read_message_id,
user: event.user,
unread_messages: 0,
};
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ export type Event<StreamChatGenerics extends ExtendableGenerics = DefaultGeneric
connection_id?: string;
created_at?: string;
hard_delete?: boolean;
last_read_message_id?: string;
mark_messages_deleted?: boolean;
me?: OwnUserResponse<StreamChatGenerics>;
member?: ChannelMemberResponse<StreamChatGenerics>;
Expand Down

0 comments on commit b152b42

Please sign in to comment.