stream-chat-angular 4.45.1 → 4.45.2
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 +49 -1
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel.service.js +33 -1
- package/esm2015/lib/chat-client.service.js +20 -2
- package/fesm2015/stream-chat-angular.js +57 -7
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel.service.d.ts +2 -1
- package/lib/chat-client.service.d.ts +2 -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.45.
|
|
1
|
+
export declare const version = "4.45.2";
|
|
@@ -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.45.
|
|
359
|
+
var version = '4.45.2';
|
|
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.
|
|
@@ -521,6 +521,7 @@
|
|
|
521
521
|
this.pendingInvitesSubject.next(channels);
|
|
522
522
|
this.appSettingsSubject.next(undefined);
|
|
523
523
|
this.subscriptions.push(this.chatClient.on(function (e) {
|
|
524
|
+
_this.updateUser(e);
|
|
524
525
|
_this.updatePendingInvites(e);
|
|
525
526
|
_this.notificationSubject.next({
|
|
526
527
|
eventType: e.type,
|
|
@@ -648,6 +649,23 @@
|
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
651
|
};
|
|
652
|
+
ChatClientService.prototype.updateUser = function (e) {
|
|
653
|
+
var _a;
|
|
654
|
+
if (typeof e.total_unread_count !== 'undefined') {
|
|
655
|
+
var user_1;
|
|
656
|
+
this.userSubject.pipe(rxjs.take(1)).subscribe(function (u) {
|
|
657
|
+
user_1 = u;
|
|
658
|
+
});
|
|
659
|
+
if (user_1 && user_1.total_unread_count !== e.total_unread_count) {
|
|
660
|
+
this.userSubject.next(Object.assign(Object.assign({}, user_1), { total_unread_count: e.total_unread_count }));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (e.type === 'user.updated' &&
|
|
664
|
+
this.chatClient.user &&
|
|
665
|
+
((_a = e.user) === null || _a === void 0 ? void 0 : _a.id) === this.chatClient.user.id) {
|
|
666
|
+
this.userSubject.next(Object.assign({}, this.chatClient.user));
|
|
667
|
+
}
|
|
668
|
+
};
|
|
651
669
|
return ChatClientService;
|
|
652
670
|
}());
|
|
653
671
|
ChatClientService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, deps: [{ token: i0__namespace.NgZone }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -1594,6 +1612,36 @@
|
|
|
1594
1612
|
_this.handleRemovedFromChannelNotification(clientEvent);
|
|
1595
1613
|
}
|
|
1596
1614
|
});
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
case 'user.updated': {
|
|
1618
|
+
this.ngZone.run(function () {
|
|
1619
|
+
var _a;
|
|
1620
|
+
var updatedChannels = (_a = _this.channelsSubject.getValue()) === null || _a === void 0 ? void 0 : _a.map(function (c) {
|
|
1621
|
+
if (_this.chatClientService.chatClient.activeChannels[c.cid]) {
|
|
1622
|
+
return _this.chatClientService.chatClient.activeChannels[c.cid];
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
return c;
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
_this.channelsSubject.next(updatedChannels);
|
|
1629
|
+
var activeChannel = _this.activeChannelSubject.getValue();
|
|
1630
|
+
if (activeChannel) {
|
|
1631
|
+
_this.activeChannelSubject.next(_this.chatClientService.chatClient.activeChannels[activeChannel.cid] || activeChannel);
|
|
1632
|
+
_this.activeChannelMessagesSubject.next(activeChannel.state.messages.map(function (m) {
|
|
1633
|
+
m.readBy = getReadBy(m, activeChannel);
|
|
1634
|
+
return Object.assign({}, m);
|
|
1635
|
+
}));
|
|
1636
|
+
var activeParentMessage = _this.activeParentMessageIdSubject.getValue();
|
|
1637
|
+
if (activeParentMessage) {
|
|
1638
|
+
var messages = activeChannel.state.threads[activeParentMessage];
|
|
1639
|
+
_this.activeThreadMessagesSubject.next(__spreadArray([], __read(messages)));
|
|
1640
|
+
}
|
|
1641
|
+
_this.activeChannelPinnedMessagesSubject.next(__spreadArray([], __read(activeChannel.state.pinnedMessages)));
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
break;
|
|
1597
1645
|
}
|
|
1598
1646
|
}
|
|
1599
1647
|
};
|