stream-chat-angular 4.39.0 → 4.39.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 +40 -23
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel.service.js +44 -25
- package/fesm2015/stream-chat-angular.js +44 -25
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel.service.d.ts +1 -0
- 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.39.
|
|
1
|
+
export declare const version = "4.39.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.39.
|
|
359
|
+
var version = '4.39.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.
|
|
@@ -806,7 +806,6 @@
|
|
|
806
806
|
* @param channel
|
|
807
807
|
*/
|
|
808
808
|
ChannelService.prototype.setAsActiveChannel = function (channel) {
|
|
809
|
-
var _this = this;
|
|
810
809
|
var prevActiveChannel = this.activeChannelSubject.getValue();
|
|
811
810
|
if ((prevActiveChannel === null || prevActiveChannel === void 0 ? void 0 : prevActiveChannel.cid) === channel.cid) {
|
|
812
811
|
return;
|
|
@@ -815,23 +814,7 @@
|
|
|
815
814
|
this.watchForActiveChannelEvents(channel);
|
|
816
815
|
this.addChannel(channel);
|
|
817
816
|
this.activeChannelSubject.next(channel);
|
|
818
|
-
|
|
819
|
-
m.readBy = getReadBy(m, channel);
|
|
820
|
-
m.translation = getMessageTranslation(m, channel, _this.chatClientService.chatClient.user);
|
|
821
|
-
if (m.quoted_message) {
|
|
822
|
-
m.quoted_message.translation = getMessageTranslation(m.quoted_message, channel, _this.chatClientService.chatClient.user);
|
|
823
|
-
}
|
|
824
|
-
});
|
|
825
|
-
if (this.canSendReadEvents && this.shouldMarkActiveChannelAsRead) {
|
|
826
|
-
void channel.markRead();
|
|
827
|
-
}
|
|
828
|
-
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
829
|
-
this.activeChannelPinnedMessagesSubject.next(__spreadArray([], __read(channel.state.pinnedMessages)));
|
|
830
|
-
this.activeParentMessageIdSubject.next(undefined);
|
|
831
|
-
this.activeThreadMessagesSubject.next([]);
|
|
832
|
-
this.messageToQuoteSubject.next(undefined);
|
|
833
|
-
this.usersTypingInChannelSubject.next([]);
|
|
834
|
-
this.usersTypingInThreadSubject.next([]);
|
|
817
|
+
this.setChannelState(channel);
|
|
835
818
|
};
|
|
836
819
|
/**
|
|
837
820
|
* Deselects the currently active (if any) channel
|
|
@@ -1474,7 +1457,7 @@
|
|
|
1474
1457
|
switch (clientEvent.eventType) {
|
|
1475
1458
|
case 'connection.recovered': {
|
|
1476
1459
|
void this.ngZone.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1477
|
-
var shoulSetActiveChannel, _a_1;
|
|
1460
|
+
var shoulSetActiveChannel, messageToQuote_1, messages_3, updatedMessageToQuote, _a_1;
|
|
1478
1461
|
return __generator(this, function (_h) {
|
|
1479
1462
|
switch (_h.label) {
|
|
1480
1463
|
case 0:
|
|
@@ -1493,8 +1476,19 @@
|
|
|
1493
1476
|
return [4 /*yield*/, this.queryChannels(shoulSetActiveChannel || false, true)];
|
|
1494
1477
|
case 2:
|
|
1495
1478
|
_h.sent();
|
|
1496
|
-
|
|
1497
|
-
|
|
1479
|
+
if (this.activeChannelSubject.getValue()) {
|
|
1480
|
+
// Thread messages are not refetched so active thread gets deselected to avoid displaying stale messages
|
|
1481
|
+
void this.setAsActiveParentMessage(undefined);
|
|
1482
|
+
messageToQuote_1 = this.messageToQuoteSubject.getValue();
|
|
1483
|
+
this.setChannelState(this.activeChannelSubject.getValue());
|
|
1484
|
+
this.activeChannelMessages$
|
|
1485
|
+
.pipe(operators.take(1))
|
|
1486
|
+
.subscribe(function (m) { return (messages_3 = m); });
|
|
1487
|
+
updatedMessageToQuote = messages_3.find(function (m) { return m.id === (messageToQuote_1 === null || messageToQuote_1 === void 0 ? void 0 : messageToQuote_1.id); });
|
|
1488
|
+
if (updatedMessageToQuote) {
|
|
1489
|
+
this.selectMessageToQuote(updatedMessageToQuote);
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1498
1492
|
this.isStateRecoveryInProgress = false;
|
|
1499
1493
|
return [3 /*break*/, 4];
|
|
1500
1494
|
case 3:
|
|
@@ -1608,7 +1602,10 @@
|
|
|
1608
1602
|
this.activeChannelSubscriptions.push(channel.on('message.new', function (event) {
|
|
1609
1603
|
_this.ngZone.run(function () {
|
|
1610
1604
|
event.message && event.message.parent_id
|
|
1611
|
-
?
|
|
1605
|
+
? event.message.parent_id ===
|
|
1606
|
+
_this.activeParentMessageIdSubject.getValue()
|
|
1607
|
+
? _this.activeThreadMessagesSubject.next(__spreadArray([], __read(channel.state.threads[event.message.parent_id])))
|
|
1608
|
+
: null
|
|
1612
1609
|
: _this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
1613
1610
|
_this.activeChannel$.pipe(operators.first()).subscribe(function (c) {
|
|
1614
1611
|
if (_this.canSendReadEvents && _this.shouldMarkActiveChannelAsRead) {
|
|
@@ -2035,6 +2032,26 @@
|
|
|
2035
2032
|
this.latestMessageDateByUserByChannelsSubject.next(Object.assign({}, latestMessages));
|
|
2036
2033
|
}
|
|
2037
2034
|
};
|
|
2035
|
+
ChannelService.prototype.setChannelState = function (channel) {
|
|
2036
|
+
var _this = this;
|
|
2037
|
+
channel.state.messages.forEach(function (m) {
|
|
2038
|
+
m.readBy = getReadBy(m, channel);
|
|
2039
|
+
m.translation = getMessageTranslation(m, channel, _this.chatClientService.chatClient.user);
|
|
2040
|
+
if (m.quoted_message) {
|
|
2041
|
+
m.quoted_message.translation = getMessageTranslation(m.quoted_message, channel, _this.chatClientService.chatClient.user);
|
|
2042
|
+
}
|
|
2043
|
+
});
|
|
2044
|
+
if (this.canSendReadEvents && this.shouldMarkActiveChannelAsRead) {
|
|
2045
|
+
void channel.markRead();
|
|
2046
|
+
}
|
|
2047
|
+
this.activeChannelMessagesSubject.next(__spreadArray([], __read(channel.state.messages)));
|
|
2048
|
+
this.activeChannelPinnedMessagesSubject.next(__spreadArray([], __read(channel.state.pinnedMessages)));
|
|
2049
|
+
this.activeParentMessageIdSubject.next(undefined);
|
|
2050
|
+
this.activeThreadMessagesSubject.next([]);
|
|
2051
|
+
this.messageToQuoteSubject.next(undefined);
|
|
2052
|
+
this.usersTypingInChannelSubject.next([]);
|
|
2053
|
+
this.usersTypingInThreadSubject.next([]);
|
|
2054
|
+
};
|
|
2038
2055
|
return ChannelService;
|
|
2039
2056
|
}());
|
|
2040
2057
|
ChannelService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelService, deps: [{ token: ChatClientService }, { token: i0__namespace.NgZone }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|