stream-chat-angular 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ import transliterate from '@stream-io/transliterate';
19
19
  import * as i8$1 from 'angular-mentions';
20
20
  import { MentionModule } from 'angular-mentions';
21
21
 
22
- const version = '5.1.2';
22
+ const version = '5.1.3';
23
23
 
24
24
  /**
25
25
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -613,12 +613,11 @@ class ChannelService {
613
613
  this.areReadEventsPaused = false;
614
614
  const readState = channel.state.read[this.chatClientService.chatClient.user?.id || ''];
615
615
  this.activeChannelLastReadMessageId = readState?.last_read_message_id;
616
- this.activeChannelUnreadCount = readState?.unread_messages || 0;
617
616
  if (channel.state.latestMessages[channel.state.latestMessages.length - 1]
618
- ?.id === this.activeChannelLastReadMessageId ||
619
- this.activeChannelUnreadCount === 0) {
617
+ ?.id === this.activeChannelLastReadMessageId) {
620
618
  this.activeChannelLastReadMessageId = undefined;
621
619
  }
620
+ this.activeChannelUnreadCount = readState?.unread_messages || 0;
622
621
  this.watchForActiveChannelEvents(channel);
623
622
  this.addChannel(channel);
624
623
  this.activeChannelSubject.next(channel);
@@ -1411,9 +1410,6 @@ class ChannelService {
1411
1410
  this.ngZone.run(() => {
1412
1411
  this.activeChannelLastReadMessageId = e.last_read_message_id;
1413
1412
  this.activeChannelUnreadCount = e.unread_messages;
1414
- if (this.activeChannelUnreadCount === 0) {
1415
- this.activeChannelLastReadMessageId = undefined;
1416
- }
1417
1413
  this.activeChannelSubject.next(this.activeChannel);
1418
1414
  });
1419
1415
  }));
@@ -1903,8 +1899,7 @@ class ChannelService {
1903
1899
  markRead(channel, isThrottled = true) {
1904
1900
  if (this.canSendReadEvents &&
1905
1901
  this.shouldMarkActiveChannelAsRead &&
1906
- !this.areReadEventsPaused &&
1907
- channel.countUnread() > 0) {
1902
+ !this.areReadEventsPaused) {
1908
1903
  if (isThrottled) {
1909
1904
  this.markReadThrottled(channel);
1910
1905
  }