stream-chat 8.18.0 → 8.18.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/dist/browser.es.js +28 -14
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +28 -14
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +28 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +28 -14
- package/dist/index.js.map +1 -1
- package/dist/types/client.d.ts +2 -4
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/thread.d.ts +5 -0
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/types.d.ts +12 -18
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +6 -6
- package/src/thread.ts +18 -6
- package/src/types.ts +12 -22
- package/src/utils.ts +1 -0
package/dist/browser.es.js
CHANGED
|
@@ -159,6 +159,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
159
159
|
total_unread_count: true,
|
|
160
160
|
unread_channels: true,
|
|
161
161
|
unread_count: true,
|
|
162
|
+
unread_threads: true,
|
|
162
163
|
invisible: true,
|
|
163
164
|
roles: true
|
|
164
165
|
};
|
|
@@ -6751,20 +6752,22 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6751
6752
|
this._channel = client.channel(t.channel.type, t.channel.id);
|
|
6752
6753
|
this._client = client;
|
|
6753
6754
|
|
|
6754
|
-
|
|
6755
|
-
|
|
6755
|
+
if (t.read) {
|
|
6756
|
+
var _iterator = _createForOfIteratorHelper$1(t.read),
|
|
6757
|
+
_step;
|
|
6756
6758
|
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6759
|
+
try {
|
|
6760
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6761
|
+
var r = _step.value;
|
|
6762
|
+
this.read[r.user.id] = _objectSpread$1(_objectSpread$1({}, r), {}, {
|
|
6763
|
+
last_read: new Date(r.last_read)
|
|
6764
|
+
});
|
|
6765
|
+
}
|
|
6766
|
+
} catch (err) {
|
|
6767
|
+
_iterator.e(err);
|
|
6768
|
+
} finally {
|
|
6769
|
+
_iterator.f();
|
|
6763
6770
|
}
|
|
6764
|
-
} catch (err) {
|
|
6765
|
-
_iterator.e(err);
|
|
6766
|
-
} finally {
|
|
6767
|
-
_iterator.f();
|
|
6768
6771
|
}
|
|
6769
6772
|
}
|
|
6770
6773
|
|
|
@@ -6773,10 +6776,20 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6773
6776
|
value: function getClient() {
|
|
6774
6777
|
return this._client;
|
|
6775
6778
|
}
|
|
6779
|
+
/**
|
|
6780
|
+
* addReply - Adds or updates a latestReplies to the thread
|
|
6781
|
+
*
|
|
6782
|
+
* @param {MessageResponse<StreamChatGenerics>} message reply message to be added.
|
|
6783
|
+
*/
|
|
6784
|
+
|
|
6776
6785
|
}, {
|
|
6777
6786
|
key: "addReply",
|
|
6778
6787
|
value: function addReply(message) {
|
|
6779
|
-
|
|
6788
|
+
if (message.parent_id !== this.message.id) {
|
|
6789
|
+
throw new Error('Message does not belong to this thread');
|
|
6790
|
+
}
|
|
6791
|
+
|
|
6792
|
+
this.latestReplies = addToMessageList(this.latestReplies, formatMessage(message), true);
|
|
6780
6793
|
}
|
|
6781
6794
|
}, {
|
|
6782
6795
|
key: "updateReply",
|
|
@@ -6802,6 +6815,7 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6802
6815
|
|
|
6803
6816
|
if (message.parent_id && message.parent_id === this.message.id) {
|
|
6804
6817
|
this.updateReply(message);
|
|
6818
|
+
return;
|
|
6805
6819
|
}
|
|
6806
6820
|
|
|
6807
6821
|
if (!message.parent_id && message.id === this.message.id) {
|
|
@@ -11142,7 +11156,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11142
11156
|
}, {
|
|
11143
11157
|
key: "getUserAgent",
|
|
11144
11158
|
value: function getUserAgent() {
|
|
11145
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.
|
|
11159
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.1");
|
|
11146
11160
|
}
|
|
11147
11161
|
}, {
|
|
11148
11162
|
key: "setUserAgent",
|