stream-chat-angular 3.7.3 → 3.7.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 = "3.7.3";
1
+ export declare const version = "3.7.4";
@@ -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.7.3';
357
+ var version = '3.7.4';
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.
@@ -1437,13 +1437,21 @@
1437
1437
  ChannelService.prototype.messageUpdated = function (event) {
1438
1438
  var _this = this;
1439
1439
  this.ngZone.run(function () {
1440
+ var _a;
1440
1441
  var isThreadReply = event.message && event.message.parent_id;
1442
+ var channel = _this.activeChannelSubject.getValue();
1443
+ if (!channel) {
1444
+ return;
1445
+ }
1446
+ // Get messages from state as message order could change, and message could've been deleted
1441
1447
  var messages = isThreadReply
1442
- ? _this.activeThreadMessagesSubject.getValue()
1443
- : _this.activeChannelMessagesSubject.getValue();
1444
- var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
1445
- if (messageIndex !== -1 && event.message) {
1446
- messages[messageIndex] = event.message;
1448
+ ? channel.state.threads[((_a = event === null || event === void 0 ? void 0 : event.message) === null || _a === void 0 ? void 0 : _a.parent_id) || '']
1449
+ : channel.state.messages;
1450
+ if (!messages) {
1451
+ return;
1452
+ }
1453
+ var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event === null || event === void 0 ? void 0 : event.message) === null || _a === void 0 ? void 0 : _a.id); });
1454
+ if (messageIndex !== -1) {
1447
1455
  isThreadReply
1448
1456
  ? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)))
1449
1457
  : _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));