stream-chat-angular 3.2.2 → 3.3.0

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.
@@ -1 +1 @@
1
- export declare const version = "3.2.2";
1
+ export declare const version = "3.3.0";
@@ -354,7 +354,7 @@
354
354
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
355
355
  }
356
356
 
357
- var version = '3.2.2';
357
+ var version = '3.3.0';
358
358
 
359
359
  /**
360
360
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -659,6 +659,10 @@
659
659
  var _this = this;
660
660
  this.chatClientService = chatClientService;
661
661
  this.ngZone = ngZone;
662
+ /**
663
+ * If set to false, read events won't be sent as new messages are received
664
+ */
665
+ this.shouldMarkActiveChannelAsRead = true;
662
666
  this.channelsSubject = new rxjs.BehaviorSubject(undefined);
663
667
  this.activeChannelSubject = new rxjs.BehaviorSubject(undefined);
664
668
  this.activeChannelMessagesSubject = new rxjs.BehaviorSubject([]);
@@ -739,7 +743,7 @@
739
743
  channel.state.messages.forEach(function (m) {
740
744
  m.readBy = getReadBy(m, channel);
741
745
  });
742
- if (this.canSendReadEvents) {
746
+ if (this.canSendReadEvents && this.shouldMarkActiveChannelAsRead) {
743
747
  void channel.markRead();
744
748
  }
745
749
  this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
@@ -1307,7 +1311,7 @@
1307
1311
  ? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[event.message.parent_id])))
1308
1312
  : _this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
1309
1313
  _this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
1310
- if (_this.canSendReadEvents) {
1314
+ if (_this.canSendReadEvents && _this.shouldMarkActiveChannelAsRead) {
1311
1315
  void (c === null || c === void 0 ? void 0 : c.markRead());
1312
1316
  }
1313
1317
  });