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/index.es.js
CHANGED
|
@@ -160,6 +160,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
160
160
|
total_unread_count: true,
|
|
161
161
|
unread_channels: true,
|
|
162
162
|
unread_count: true,
|
|
163
|
+
unread_threads: true,
|
|
163
164
|
invisible: true,
|
|
164
165
|
roles: true
|
|
165
166
|
};
|
|
@@ -6754,20 +6755,22 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6754
6755
|
this._channel = client.channel(t.channel.type, t.channel.id);
|
|
6755
6756
|
this._client = client;
|
|
6756
6757
|
|
|
6757
|
-
|
|
6758
|
-
|
|
6758
|
+
if (t.read) {
|
|
6759
|
+
var _iterator = _createForOfIteratorHelper$1(t.read),
|
|
6760
|
+
_step;
|
|
6759
6761
|
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6762
|
+
try {
|
|
6763
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6764
|
+
var r = _step.value;
|
|
6765
|
+
this.read[r.user.id] = _objectSpread$1(_objectSpread$1({}, r), {}, {
|
|
6766
|
+
last_read: new Date(r.last_read)
|
|
6767
|
+
});
|
|
6768
|
+
}
|
|
6769
|
+
} catch (err) {
|
|
6770
|
+
_iterator.e(err);
|
|
6771
|
+
} finally {
|
|
6772
|
+
_iterator.f();
|
|
6766
6773
|
}
|
|
6767
|
-
} catch (err) {
|
|
6768
|
-
_iterator.e(err);
|
|
6769
|
-
} finally {
|
|
6770
|
-
_iterator.f();
|
|
6771
6774
|
}
|
|
6772
6775
|
}
|
|
6773
6776
|
|
|
@@ -6776,10 +6779,20 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6776
6779
|
value: function getClient() {
|
|
6777
6780
|
return this._client;
|
|
6778
6781
|
}
|
|
6782
|
+
/**
|
|
6783
|
+
* addReply - Adds or updates a latestReplies to the thread
|
|
6784
|
+
*
|
|
6785
|
+
* @param {MessageResponse<StreamChatGenerics>} message reply message to be added.
|
|
6786
|
+
*/
|
|
6787
|
+
|
|
6779
6788
|
}, {
|
|
6780
6789
|
key: "addReply",
|
|
6781
6790
|
value: function addReply(message) {
|
|
6782
|
-
|
|
6791
|
+
if (message.parent_id !== this.message.id) {
|
|
6792
|
+
throw new Error('Message does not belong to this thread');
|
|
6793
|
+
}
|
|
6794
|
+
|
|
6795
|
+
this.latestReplies = addToMessageList(this.latestReplies, formatMessage(message), true);
|
|
6783
6796
|
}
|
|
6784
6797
|
}, {
|
|
6785
6798
|
key: "updateReply",
|
|
@@ -6805,6 +6818,7 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6805
6818
|
|
|
6806
6819
|
if (message.parent_id && message.parent_id === this.message.id) {
|
|
6807
6820
|
this.updateReply(message);
|
|
6821
|
+
return;
|
|
6808
6822
|
}
|
|
6809
6823
|
|
|
6810
6824
|
if (!message.parent_id && message.id === this.message.id) {
|
|
@@ -11145,7 +11159,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11145
11159
|
}, {
|
|
11146
11160
|
key: "getUserAgent",
|
|
11147
11161
|
value: function getUserAgent() {
|
|
11148
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.
|
|
11162
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.1");
|
|
11149
11163
|
}
|
|
11150
11164
|
}, {
|
|
11151
11165
|
key: "setUserAgent",
|