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.js
CHANGED
|
@@ -184,6 +184,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
184
184
|
total_unread_count: true,
|
|
185
185
|
unread_channels: true,
|
|
186
186
|
unread_count: true,
|
|
187
|
+
unread_threads: true,
|
|
187
188
|
invisible: true,
|
|
188
189
|
roles: true
|
|
189
190
|
};
|
|
@@ -6776,20 +6777,22 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6776
6777
|
this._channel = client.channel(t.channel.type, t.channel.id);
|
|
6777
6778
|
this._client = client;
|
|
6778
6779
|
|
|
6779
|
-
|
|
6780
|
-
|
|
6780
|
+
if (t.read) {
|
|
6781
|
+
var _iterator = _createForOfIteratorHelper$1(t.read),
|
|
6782
|
+
_step;
|
|
6781
6783
|
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6784
|
+
try {
|
|
6785
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6786
|
+
var r = _step.value;
|
|
6787
|
+
this.read[r.user.id] = _objectSpread$1(_objectSpread$1({}, r), {}, {
|
|
6788
|
+
last_read: new Date(r.last_read)
|
|
6789
|
+
});
|
|
6790
|
+
}
|
|
6791
|
+
} catch (err) {
|
|
6792
|
+
_iterator.e(err);
|
|
6793
|
+
} finally {
|
|
6794
|
+
_iterator.f();
|
|
6788
6795
|
}
|
|
6789
|
-
} catch (err) {
|
|
6790
|
-
_iterator.e(err);
|
|
6791
|
-
} finally {
|
|
6792
|
-
_iterator.f();
|
|
6793
6796
|
}
|
|
6794
6797
|
}
|
|
6795
6798
|
|
|
@@ -6798,10 +6801,20 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6798
6801
|
value: function getClient() {
|
|
6799
6802
|
return this._client;
|
|
6800
6803
|
}
|
|
6804
|
+
/**
|
|
6805
|
+
* addReply - Adds or updates a latestReplies to the thread
|
|
6806
|
+
*
|
|
6807
|
+
* @param {MessageResponse<StreamChatGenerics>} message reply message to be added.
|
|
6808
|
+
*/
|
|
6809
|
+
|
|
6801
6810
|
}, {
|
|
6802
6811
|
key: "addReply",
|
|
6803
6812
|
value: function addReply(message) {
|
|
6804
|
-
|
|
6813
|
+
if (message.parent_id !== this.message.id) {
|
|
6814
|
+
throw new Error('Message does not belong to this thread');
|
|
6815
|
+
}
|
|
6816
|
+
|
|
6817
|
+
this.latestReplies = addToMessageList(this.latestReplies, formatMessage(message), true);
|
|
6805
6818
|
}
|
|
6806
6819
|
}, {
|
|
6807
6820
|
key: "updateReply",
|
|
@@ -6827,6 +6840,7 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6827
6840
|
|
|
6828
6841
|
if (message.parent_id && message.parent_id === this.message.id) {
|
|
6829
6842
|
this.updateReply(message);
|
|
6843
|
+
return;
|
|
6830
6844
|
}
|
|
6831
6845
|
|
|
6832
6846
|
if (!message.parent_id && message.id === this.message.id) {
|
|
@@ -11167,7 +11181,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11167
11181
|
}, {
|
|
11168
11182
|
key: "getUserAgent",
|
|
11169
11183
|
value: function getUserAgent() {
|
|
11170
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.
|
|
11184
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.1");
|
|
11171
11185
|
}
|
|
11172
11186
|
}, {
|
|
11173
11187
|
key: "setUserAgent",
|