@stream-io/video-client 0.0.12 → 0.0.13
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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +14 -15
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +14 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +14 -15
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/StreamVideoClient.ts +13 -15
package/package.json
CHANGED
package/src/StreamVideoClient.ts
CHANGED
|
@@ -195,22 +195,20 @@ export class StreamVideoClient {
|
|
|
195
195
|
|
|
196
196
|
// The call might already be tracked by the client,
|
|
197
197
|
// if `call.created` was received before `call.ring`.
|
|
198
|
-
// In that case, we
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
198
|
+
// In that case, we cleanup the already tracked call.
|
|
199
|
+
const prevCall = this.writeableStateStore.findCall(call.type, call.id);
|
|
200
|
+
await prevCall?.leave();
|
|
201
|
+
// we create a new call
|
|
202
|
+
const theCall = new Call({
|
|
203
|
+
streamClient: this.streamClient,
|
|
204
|
+
type: call.type,
|
|
205
|
+
id: call.id,
|
|
206
|
+
members,
|
|
207
|
+
clientStore: this.writeableStateStore,
|
|
208
|
+
ringing: true,
|
|
209
|
+
});
|
|
212
210
|
// we fetch the latest metadata for the call from the server
|
|
213
|
-
await theCall.get(
|
|
211
|
+
await theCall.get();
|
|
214
212
|
this.writeableStateStore.registerCall(theCall);
|
|
215
213
|
}),
|
|
216
214
|
);
|