Skip to content

Commit dc64036

Browse files
committed
fix: read by data is based on message.created_at #402
1 parent 2580ecc commit dc64036

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

projects/stream-chat-angular/src/lib/read-by.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('getReadBy', () => {
77
const sender = { id: 'sender', name: 'Tess' };
88

99
const message = {
10-
updated_at: new Date('2021-09-14T13:08:30.004112Z'),
10+
created_at: new Date('2021-09-14T13:08:30.004112Z'),
1111
user: sender,
1212
} as FormatMessageResponse<DefaultStreamChatGenerics>;
1313
const channel = {

projects/stream-chat-angular/src/lib/read-by.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getReadBy = <
1111
Object.keys(channel.state.read).forEach((key) => {
1212
if (
1313
channel.state.read[key].last_read.getTime() >=
14-
message.updated_at.getTime() &&
14+
message.created_at.getTime() &&
1515
message.user?.id !== key
1616
) {
1717
readBy.push(channel.state.read[key].user);

0 commit comments

Comments
 (0)