stream-chat-angular 4.52.3 → 4.53.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 = "4.52.3";
1
+ export declare const version = "4.53.0";
@@ -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.52.3';
359
+ var version = '4.53.0';
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.
@@ -480,6 +480,7 @@
480
480
  switch (_d.label) {
481
481
  case 0:
482
482
  this.chatClient = streamChat.StreamChat.getInstance(apiKey, clientOptions);
483
+ this.chatClient.recoverStateOnReconnect = false;
483
484
  this.chatClient.devToken;
484
485
  return [4 /*yield*/, this.ngZone.runOutsideAngular(function () { return __awaiter(_this, void 0, void 0, function () {
485
486
  var _b, user, error_1, sdkPrefix;
@@ -1942,12 +1943,12 @@
1942
1943
  if (recoverState === void 0) { recoverState = false; }
1943
1944
  var _a, _b;
1944
1945
  return __awaiter(this, void 0, void 0, function () {
1945
- var filters, options, channels, prevChannels_1, filteredChannels, currentActiveChannel_1, error_6;
1946
+ var filters, options, channels, prevChannels_1, filteredChannels, currentActiveChannel_1, isCurrentActiveChannelDeselected, nextChannels, e_1, error_6;
1946
1947
  var _this = this;
1947
1948
  return __generator(this, function (_h) {
1948
1949
  switch (_h.label) {
1949
1950
  case 0:
1950
- _h.trys.push([0, 2, , 3]);
1951
+ _h.trys.push([0, 6, , 7]);
1951
1952
  this.channelQueryStateSubject.next({ state: 'in-progress' });
1952
1953
  filters = void 0;
1953
1954
  options = void 0;
@@ -1974,18 +1975,35 @@
1974
1975
  ? []
1975
1976
  : this.channelsSubject.getValue() || [];
1976
1977
  filteredChannels = channels.filter(function (channel) { return !prevChannels_1.find(function (existingChannel) { return existingChannel.cid === channel.cid; }); });
1977
- this.channelsSubject.next(__spreadArray(__spreadArray([], __read(prevChannels_1)), __read(filteredChannels)));
1978
1978
  currentActiveChannel_1 = this.activeChannelSubject.getValue();
1979
+ isCurrentActiveChannelDeselected = false;
1980
+ nextChannels = __spreadArray(__spreadArray([], __read(prevChannels_1)), __read(filteredChannels));
1981
+ if (!(recoverState &&
1982
+ currentActiveChannel_1 &&
1983
+ !filteredChannels.find(function (c) { return c.cid === (currentActiveChannel_1 === null || currentActiveChannel_1 === void 0 ? void 0 : currentActiveChannel_1.cid); }))) return [3 /*break*/, 5];
1984
+ _h.label = 2;
1985
+ case 2:
1986
+ _h.trys.push([2, 4, , 5]);
1987
+ return [4 /*yield*/, currentActiveChannel_1.watch()];
1988
+ case 3:
1989
+ _h.sent();
1990
+ nextChannels.unshift(currentActiveChannel_1);
1991
+ return [3 /*break*/, 5];
1992
+ case 4:
1993
+ e_1 = _h.sent();
1994
+ isCurrentActiveChannelDeselected = true;
1995
+ return [3 /*break*/, 5];
1996
+ case 5:
1997
+ this.channelsSubject.next(nextChannels);
1998
+ if (isCurrentActiveChannelDeselected) {
1999
+ this.deselectActiveChannel();
2000
+ }
1979
2001
  if (filteredChannels.length > 0 &&
1980
2002
  !currentActiveChannel_1 &&
1981
2003
  shouldSetActiveChannel) {
1982
2004
  this.setAsActiveChannel(filteredChannels[0]);
1983
2005
  currentActiveChannel_1 = this.activeChannelSubject.getValue();
1984
2006
  }
1985
- if (recoverState &&
1986
- !filteredChannels.find(function (c) { return c.cid === (currentActiveChannel_1 === null || currentActiveChannel_1 === void 0 ? void 0 : currentActiveChannel_1.cid); })) {
1987
- this.deselectActiveChannel();
1988
- }
1989
2007
  this.hasMoreChannelsSubject.next(channels.length >= this.options.limit);
1990
2008
  this.channelQueryStateSubject.next({ state: 'success' });
1991
2009
  if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.keepAliveChannels$OnError) &&
@@ -1993,7 +2011,7 @@
1993
2011
  this.dismissErrorNotification();
1994
2012
  }
1995
2013
  return [2 /*return*/, channels];
1996
- case 2:
2014
+ case 6:
1997
2015
  error_6 = _h.sent();
1998
2016
  if (!((_b = this.options) === null || _b === void 0 ? void 0 : _b.keepAliveChannels$OnError)) {
1999
2017
  this.channelsSubject.error(error_6);
@@ -2004,7 +2022,7 @@
2004
2022
  error: error_6,
2005
2023
  });
2006
2024
  throw error_6;
2007
- case 3: return [2 /*return*/];
2025
+ case 7: return [2 /*return*/];
2008
2026
  }
2009
2027
  });
2010
2028
  });