stream-chat 8.40.3 → 8.40.5

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.
package/dist/index.es.js CHANGED
@@ -422,8 +422,10 @@ function addToMessageList(messages, newMessage) {
422
422
  } // for empty list just concat and return unless it's an update or deletion
423
423
 
424
424
 
425
- if (!newMessages.length && addMessageToList) {
425
+ if (newMessages.length === 0 && addMessageToList) {
426
426
  return newMessages.concat(newMessage);
427
+ } else if (newMessages.length === 0) {
428
+ return newMessages;
427
429
  } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
428
430
 
429
431
 
@@ -433,6 +435,8 @@ function addToMessageList(messages, newMessage) {
433
435
 
434
436
  if (messageIsNewest && addMessageToList) {
435
437
  return newMessages.concat(newMessage);
438
+ } else if (messageIsNewest) {
439
+ return newMessages;
436
440
  } // find the closest index to push the new message
437
441
 
438
442
 
@@ -7337,6 +7341,7 @@ var MARK_AS_READ_THROTTLE_TIMEOUT = 1000;
7337
7341
  var Thread = /*#__PURE__*/function () {
7338
7342
  function Thread(_ref) {
7339
7343
  var _this = this,
7344
+ _threadData$channel$m,
7340
7345
  _threadData$read,
7341
7346
  _threadData$reply_cou;
7342
7347
 
@@ -7892,9 +7897,7 @@ var Thread = /*#__PURE__*/function () {
7892
7897
  name: threadData.channel.name
7893
7898
  });
7894
7899
 
7895
- if (threadData.channel.members) {
7896
- _channel._hydrateMembers(threadData.channel.members);
7897
- }
7900
+ _channel._hydrateMembers((_threadData$channel$m = threadData.channel.members) !== null && _threadData$channel$m !== void 0 ? _threadData$channel$m : []);
7898
7901
 
7899
7902
  this.state = new StateStore({
7900
7903
  active: false,
@@ -13330,7 +13333,7 @@ var StreamChat = /*#__PURE__*/function () {
13330
13333
  }, {
13331
13334
  key: "getUserAgent",
13332
13335
  value: function getUserAgent() {
13333
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.3");
13336
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.5");
13334
13337
  }
13335
13338
  }, {
13336
13339
  key: "setUserAgent",