stream-chat-angular 4.68.2 → 4.68.4

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 = "4.68.2";
1
+ export declare const version = "4.68.4";
@@ -356,7 +356,7 @@
356
356
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
357
357
  }
358
358
 
359
- var version = '4.68.2';
359
+ var version = '4.68.4';
360
360
 
361
361
  /**
362
362
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](../components/NotificationListComponent.mdx) component displays the currently active notifications.
@@ -789,6 +789,7 @@
789
789
  _this.activeParentMessageIdSubject.next(message === null || message === void 0 ? void 0 : message.id);
790
790
  };
791
791
  this.areReadEventsPaused = false;
792
+ this.markReadThrottleTime = 1050;
792
793
  this.channels$ = this.channelsSubject.asObservable().pipe(operators.shareReplay(1));
793
794
  this.activeChannel$ = this.activeChannelSubject
794
795
  .asObservable()
@@ -902,6 +903,7 @@
902
903
  return;
903
904
  }
904
905
  this.stopWatchForActiveChannelEvents(prevActiveChannel);
906
+ this.flushMarkReadQueue();
905
907
  this.areReadEventsPaused = false;
906
908
  var readState = channel.state.read[((_a = this.chatClientService.chatClient.user) === null || _a === void 0 ? void 0 : _a.id) || ''];
907
909
  this.activeChannelLastReadMessageId = readState === null || readState === void 0 ? void 0 : readState.last_read_message_id;
@@ -927,6 +929,7 @@
927
929
  return;
928
930
  }
929
931
  this.stopWatchForActiveChannelEvents(activeChannel);
932
+ this.flushMarkReadQueue();
930
933
  this.activeChannelMessagesSubject.next([]);
931
934
  this.activeChannelSubject.next(undefined);
932
935
  this.activeParentMessageIdSubject.next(undefined);
@@ -2469,12 +2472,41 @@
2469
2472
  this.usersTypingInChannelSubject.next([]);
2470
2473
  this.usersTypingInThreadSubject.next([]);
2471
2474
  };
2472
- ChannelService.prototype.markRead = function (channel) {
2475
+ ChannelService.prototype.markRead = function (channel, isThrottled) {
2476
+ if (isThrottled === void 0) { isThrottled = true; }
2473
2477
  if (this.canSendReadEvents &&
2474
2478
  this.shouldMarkActiveChannelAsRead &&
2475
2479
  !this.areReadEventsPaused) {
2476
- void channel.markRead();
2480
+ if (isThrottled) {
2481
+ this.markReadThrottled(channel);
2482
+ }
2483
+ else {
2484
+ void channel.markRead();
2485
+ }
2486
+ }
2487
+ };
2488
+ ChannelService.prototype.markReadThrottled = function (channel) {
2489
+ var _this = this;
2490
+ if (!this.markReadTimeout) {
2491
+ this.markRead(channel, false);
2492
+ this.markReadTimeout = setTimeout(function () {
2493
+ _this.flushMarkReadQueue();
2494
+ }, this.markReadThrottleTime);
2477
2495
  }
2496
+ else {
2497
+ clearTimeout(this.markReadTimeout);
2498
+ this.scheduledMarkReadRequest = function () { return _this.markRead(channel, false); };
2499
+ this.markReadTimeout = setTimeout(function () {
2500
+ _this.flushMarkReadQueue();
2501
+ }, this.markReadThrottleTime);
2502
+ }
2503
+ };
2504
+ ChannelService.prototype.flushMarkReadQueue = function () {
2505
+ var _a;
2506
+ (_a = this.scheduledMarkReadRequest) === null || _a === void 0 ? void 0 : _a.call(this);
2507
+ this.scheduledMarkReadRequest = undefined;
2508
+ clearTimeout(this.markReadTimeout);
2509
+ this.markReadTimeout = undefined;
2478
2510
  };
2479
2511
  ChannelService.prototype.setNextPageConfiguration = function (channelQueryResult) {
2480
2512
  var _a;
@@ -3325,6 +3357,9 @@
3325
3357
  this.setFallbackChannelImage();
3326
3358
  }
3327
3359
  };
3360
+ AvatarComponent.prototype.ngOnDestroy = function () {
3361
+ this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
3362
+ };
3328
3363
  AvatarComponent.prototype.setFallbackChannelImage = function () {
3329
3364
  if (this.type !== 'channel') {
3330
3365
  this.fallbackChannelImage = undefined;