stream-chat 8.1.0 → 8.1.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/README.md +33 -0
- package/dist/browser.es.js +6 -4
- 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 +6 -4
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +6 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +2 -2
- package/src/client.ts +93 -37
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,39 @@ await channel.sendReaction(message.id, { type: 'love', user: { id: 'vishal-1' }
|
|
|
101
101
|
|
|
102
102
|
Custom types provided when initializing the client will carry through to all client returns and provide intellisense to queries.
|
|
103
103
|
|
|
104
|
+
## 🔗 (Optional) Development Setup in Combination with our SDKs
|
|
105
|
+
|
|
106
|
+
### Connect to [Stream Chat React Native SDK](https://github.com/GetStream/stream-chat-react-native)
|
|
107
|
+
|
|
108
|
+
Run in the root of this repo
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
yarn link
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Run in the root of one of the example apps (SampleApp/TypeScriptMessaging) in the `stream-chat-react-native` repo
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
yarn link stream-chat
|
|
118
|
+
yarn start
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Open `metro.config.js` file and set value for watchFolders as
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
module.exports = {
|
|
125
|
+
...
|
|
126
|
+
watchFolders: [projectRoot].concat(alternateRoots).concat(['{{CHANGE_TO_THE_PATH_TO_YOUR_PROJECT}}/stream-chat-js'])
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Make sure to replace `{{CHANGE_TO_THE_PATH_TO_YOUR_PROJECT}}` with the correct path for stream-chat-js folder as per your directory structure
|
|
131
|
+
Run in the root of this repo
|
|
132
|
+
|
|
133
|
+
```shell
|
|
134
|
+
yarn start
|
|
135
|
+
```
|
|
136
|
+
|
|
104
137
|
## 📚 More code examples
|
|
105
138
|
|
|
106
139
|
Head over to [docs/typescript.md](./docs/typescript.md) for more examples.
|
package/dist/browser.es.js
CHANGED
|
@@ -3578,12 +3578,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3578
3578
|
break;
|
|
3579
3579
|
|
|
3580
3580
|
case 'message.read':
|
|
3581
|
-
if ((_event$user3 = event.user) !== null && _event$user3 !== void 0 && _event$user3.id) {
|
|
3581
|
+
if ((_event$user3 = event.user) !== null && _event$user3 !== void 0 && _event$user3.id && event.created_at) {
|
|
3582
3582
|
var _event$user4, _this$getClient$user;
|
|
3583
3583
|
|
|
3584
3584
|
channelState.read[event.user.id] = {
|
|
3585
3585
|
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3586
|
-
last_read: event.
|
|
3586
|
+
last_read: new Date(event.created_at),
|
|
3587
3587
|
user: event.user,
|
|
3588
3588
|
unread_messages: 0
|
|
3589
3589
|
};
|
|
@@ -8166,7 +8166,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8166
8166
|
}, {
|
|
8167
8167
|
key: "setLocalDevice",
|
|
8168
8168
|
value: function setLocalDevice(device) {
|
|
8169
|
-
|
|
8169
|
+
var _this$wsConnection5, _this$wsConnection6, _this$wsFallback4;
|
|
8170
|
+
|
|
8171
|
+
if ((_this$wsConnection5 = this.wsConnection) !== null && _this$wsConnection5 !== void 0 && _this$wsConnection5.isConnecting && this.wsPromise || ((_this$wsConnection6 = this.wsConnection) !== null && _this$wsConnection6 !== void 0 && _this$wsConnection6.isHealthy || (_this$wsFallback4 = this.wsFallback) !== null && _this$wsFallback4 !== void 0 && _this$wsFallback4.isHealthy()) && this._hasConnectionID()) {
|
|
8170
8172
|
throw new Error('you can only set device before opening a websocket connection');
|
|
8171
8173
|
}
|
|
8172
8174
|
|
|
@@ -9858,7 +9860,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9858
9860
|
}, {
|
|
9859
9861
|
key: "getUserAgent",
|
|
9860
9862
|
value: function getUserAgent() {
|
|
9861
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.1.
|
|
9863
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.1.2");
|
|
9862
9864
|
}
|
|
9863
9865
|
}, {
|
|
9864
9866
|
key: "setUserAgent",
|