stream-chat-angular 4.68.0 → 4.68.1
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/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +19 -7
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/chat-client.service.js +19 -8
- package/fesm2015/stream-chat-angular.js +19 -8
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/chat-client.service.d.ts +4 -1
- package/package.json +1 -1
- package/src/assets/version.ts +1 -1
package/assets/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.68.
|
|
1
|
+
export declare const version = "4.68.1";
|
|
@@ -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.
|
|
359
|
+
var version = '4.68.1';
|
|
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.
|
|
@@ -453,6 +453,7 @@
|
|
|
453
453
|
this.pendingInvitesSubject = new rxjs.BehaviorSubject([]);
|
|
454
454
|
this.userSubject = new rxjs.ReplaySubject(1);
|
|
455
455
|
this.subscriptions = [];
|
|
456
|
+
this.trackPendingChannelInvites = true;
|
|
456
457
|
this.events$ = this.notificationSubject.asObservable();
|
|
457
458
|
this.connectionState$ = this.connectionStateSubject.asObservable();
|
|
458
459
|
this.appSettings$ = this.appSettingsSubject.asObservable();
|
|
@@ -472,18 +473,20 @@
|
|
|
472
473
|
* @param clientOptions Setting to provide to the Stream client instance
|
|
473
474
|
*/
|
|
474
475
|
ChatClientService.prototype.init = function (apiKey, userOrId, userTokenOrProvider, clientOptions) {
|
|
475
|
-
var _a;
|
|
476
|
+
var _a, _b;
|
|
476
477
|
return __awaiter(this, void 0, void 0, function () {
|
|
477
478
|
var result, channels, removeNotification;
|
|
478
479
|
var _this = this;
|
|
479
480
|
return __generator(this, function (_d) {
|
|
480
481
|
switch (_d.label) {
|
|
481
482
|
case 0:
|
|
483
|
+
this.trackPendingChannelInvites =
|
|
484
|
+
(clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.trackPendingChannelInvites) !== false;
|
|
482
485
|
this.chatClient = streamChat.StreamChat.getInstance(apiKey, clientOptions);
|
|
483
486
|
this.chatClient.recoverStateOnReconnect = false;
|
|
484
487
|
this.chatClient.devToken;
|
|
485
488
|
return [4 /*yield*/, this.ngZone.runOutsideAngular(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
486
|
-
var
|
|
489
|
+
var _c, user, error_1, sdkPrefix;
|
|
487
490
|
var _this = this;
|
|
488
491
|
return __generator(this, function (_d) {
|
|
489
492
|
switch (_d.label) {
|
|
@@ -492,11 +495,11 @@
|
|
|
492
495
|
_d.label = 1;
|
|
493
496
|
case 1:
|
|
494
497
|
_d.trys.push([1, 3, , 4]);
|
|
495
|
-
return [4 /*yield*/, ((
|
|
498
|
+
return [4 /*yield*/, ((_c = {
|
|
496
499
|
guest: function () { return _this.chatClient.setGuestUser(user); },
|
|
497
500
|
anonymous: function () { return _this.chatClient.connectAnonymousUser(); },
|
|
498
501
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
499
|
-
}["" + userTokenOrProvider]) !== null &&
|
|
502
|
+
}["" + userTokenOrProvider]) !== null && _c !== void 0 ? _c : (function () { return _this.chatClient.connectUser(user, userTokenOrProvider); }))()];
|
|
500
503
|
case 2:
|
|
501
504
|
result = _d.sent();
|
|
502
505
|
return [3 /*break*/, 4];
|
|
@@ -516,11 +519,17 @@
|
|
|
516
519
|
}); })];
|
|
517
520
|
case 1:
|
|
518
521
|
_d.sent();
|
|
519
|
-
|
|
520
|
-
|
|
522
|
+
if (!(((_a = this.chatClient.user) === null || _a === void 0 ? void 0 : _a.id) && this.trackPendingChannelInvites)) return [3 /*break*/, 3];
|
|
523
|
+
return [4 /*yield*/, this.chatClient.queryChannels({
|
|
524
|
+
invite: 'pending',
|
|
525
|
+
members: { $in: [(_b = this.chatClient.user) === null || _b === void 0 ? void 0 : _b.id] },
|
|
526
|
+
} // TODO: find out why we need this typecast
|
|
527
|
+
)];
|
|
521
528
|
case 2:
|
|
522
529
|
channels = _d.sent();
|
|
523
530
|
this.pendingInvitesSubject.next(channels);
|
|
531
|
+
_d.label = 3;
|
|
532
|
+
case 3:
|
|
524
533
|
this.appSettingsSubject.next(undefined);
|
|
525
534
|
this.subscriptions.push(this.chatClient.on(function (e) {
|
|
526
535
|
_this.updateUser(e);
|
|
@@ -636,6 +645,9 @@
|
|
|
636
645
|
};
|
|
637
646
|
ChatClientService.prototype.updatePendingInvites = function (e) {
|
|
638
647
|
var _a, _b, _c;
|
|
648
|
+
if (!this.trackPendingChannelInvites) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
639
651
|
if (((_b = (_a = e.member) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.id) === ((_c = this.chatClient.user) === null || _c === void 0 ? void 0 : _c.id) && e.channel) {
|
|
640
652
|
var pendingInvites = this.pendingInvitesSubject.getValue();
|
|
641
653
|
if (e.type === 'notification.invited') {
|