Skip to content

Commit 369742f

Browse files
authored
Merge pull request #548 from GetStream/fix-unread-count
fix: inaccurate unread number after `notification.mark_unread`
2 parents d7ba5e3 + 29506e3 commit 369742f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

projects/stream-chat-angular/src/lib/channel.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ describe('ChannelService', () => {
24612461
eventType: 'notification.mark_unread',
24622462
event: {
24632463
channel_id: service.activeChannel?.id,
2464-
unread_count: 12,
2464+
unread_messages: 12,
24652465
last_read_message_id: 'last-read-message',
24662466
} as Event<DefaultStreamChatGenerics>,
24672467
});
@@ -2473,7 +2473,7 @@ describe('ChannelService', () => {
24732473
eventType: 'notification.mark_unread',
24742474
event: {
24752475
channel_id: 'not-active-channel',
2476-
unread_count: 20,
2476+
unread_messages: 20,
24772477
last_read_message_id: 'different id',
24782478
} as Event<DefaultStreamChatGenerics>,
24792479
});

projects/stream-chat-angular/src/lib/channel.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ export class ChannelService<
14351435
.subscribe((e) => {
14361436
this.ngZone.run(() => {
14371437
this.activeChannelLastReadMessageId = e.last_read_message_id;
1438-
this.activeChannelUnreadCount = e.unread_count;
1438+
this.activeChannelUnreadCount = e.unread_messages;
14391439
this.activeChannelSubject.next(this.activeChannel);
14401440
});
14411441
})

0 commit comments

Comments
 (0)