stream-chat-angular 5.12.4 → 5.13.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.
@@ -21,7 +21,7 @@ import transliterate from '@stream-io/transliterate';
21
21
  import * as i8$1 from 'angular-mentions';
22
22
  import { MentionModule } from 'angular-mentions';
23
23
 
24
- const version = '5.12.4';
24
+ const version = '5.13.0';
25
25
 
26
26
  /**
27
27
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
@@ -132,7 +132,7 @@ class ChatClientService {
132
132
  * @param clientOptions Setting to provide to the Stream client instance
133
133
  */
134
134
  init(apiKey, userOrId, userTokenOrProvider, clientOptions) {
135
- var _a, _b;
135
+ var _a, _b, _c;
136
136
  return __awaiter(this, void 0, void 0, function* () {
137
137
  if (this.chatClient && this.chatClient.key !== apiKey) {
138
138
  this.appSettingsSubject.next(undefined);
@@ -141,22 +141,33 @@ class ChatClientService {
141
141
  this.trackPendingChannelInvites =
142
142
  (clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.trackPendingChannelInvites) === true;
143
143
  this.chatClient = StreamChat.getInstance(apiKey, clientOptions);
144
- const sdkPrefix = 'stream-chat-angular';
145
- if (!this.chatClient.getUserAgent().includes(sdkPrefix)) {
146
- this.chatClient.setUserAgent(`${sdkPrefix}-${version}-${this.chatClient.getUserAgent()}`);
144
+ if ('sdkIdentifier' in this.chatClient) {
145
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
146
+ this.chatClient.sdkIdentifier = {
147
+ name: 'angular',
148
+ version,
149
+ };
150
+ }
151
+ else {
152
+ const userAgent = this.chatClient.getUserAgent();
153
+ if (!userAgent.includes('stream-chat-angular')) {
154
+ const parts = userAgent.split('-');
155
+ const jsVersion = (_a = parts[parts.length - 1]) !== null && _a !== void 0 ? _a : '0.0.0';
156
+ this.chatClient.setUserAgent(`stream-chat-angular-v${version}-llc-v${jsVersion}`);
157
+ }
147
158
  }
148
159
  this.chatClient.recoverStateOnReconnect = false;
149
160
  this.chatClient.devToken;
150
161
  let result;
151
162
  yield this.ngZone.runOutsideAngular(() => __awaiter(this, void 0, void 0, function* () {
152
- var _c;
163
+ var _d;
153
164
  const user = typeof userOrId === 'string' ? { id: userOrId } : userOrId;
154
165
  try {
155
- result = yield ((_c = {
166
+ result = yield ((_d = {
156
167
  guest: () => this.chatClient.setGuestUser(user),
157
168
  anonymous: () => this.chatClient.connectAnonymousUser(),
158
169
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
159
- }[`${userTokenOrProvider}`]) !== null && _c !== void 0 ? _c : (() => this.chatClient.connectUser(user, userTokenOrProvider)))();
170
+ }[`${userTokenOrProvider}`]) !== null && _d !== void 0 ? _d : (() => this.chatClient.connectUser(user, userTokenOrProvider)))();
160
171
  }
161
172
  catch (error) {
162
173
  this.notificationService.addPermanentNotification('streamChat.Error connecting to chat, refresh the page to try again.', 'error');
@@ -164,10 +175,10 @@ class ChatClientService {
164
175
  }
165
176
  this.userSubject.next(this.chatClient.user ? Object.assign({}, this.chatClient.user) : undefined);
166
177
  }));
167
- if (((_a = this.chatClient.user) === null || _a === void 0 ? void 0 : _a.id) && this.trackPendingChannelInvites) {
178
+ if (((_b = this.chatClient.user) === null || _b === void 0 ? void 0 : _b.id) && this.trackPendingChannelInvites) {
168
179
  const channels = yield this.chatClient.queryChannels({
169
180
  invite: 'pending',
170
- members: { $in: [(_b = this.chatClient.user) === null || _b === void 0 ? void 0 : _b.id] },
181
+ members: { $in: [(_c = this.chatClient.user) === null || _c === void 0 ? void 0 : _c.id] },
171
182
  } // TODO: find out why we need this typecast
172
183
  );
173
184
  this.pendingInvitesSubject.next(channels);
@@ -8593,6 +8604,12 @@ class MessageListComponent {
8593
8604
  this.cdRef.detectChanges();
8594
8605
  }, 1000));
8595
8606
  }
8607
+ else {
8608
+ this.isJumpingToMessage = false;
8609
+ this.highlightedMessageId = undefined;
8610
+ this.firstUnreadMessageId = undefined;
8611
+ this.isJumpingToLatestUnreadMessage = false;
8612
+ }
8596
8613
  }
8597
8614
  newMessageReceived(message) {
8598
8615
  var _a, _b, _c, _d;