@azure/communication-react 1.3.3-alpha-202210150019.0 → 1.3.3-alpha-202210180021.0

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.
@@ -202,7 +202,7 @@ const _toCommunicationIdentifier = (id) => {
202
202
  // Copyright (c) Microsoft Corporation.
203
203
  // Licensed under the MIT license.
204
204
  // GENERATED FILE. DO NOT EDIT MANUALLY.
205
- var telemetryVersion = '1.3.3-alpha-202210150019.0';
205
+ var telemetryVersion = '1.3.3-alpha-202210180021.0';
206
206
 
207
207
  // Copyright (c) Microsoft Corporation.
208
208
  /**
@@ -18347,15 +18347,17 @@ class CallContext {
18347
18347
  }
18348
18348
  updateClientState(clientState) {
18349
18349
  var _a;
18350
- const call = this.callId ? clientState.calls[this.callId] : undefined;
18350
+ let call = this.callId ? clientState.calls[this.callId] : undefined;
18351
18351
  const latestEndedCall = findLatestEndedCall(clientState.callsEnded);
18352
18352
  // As the state is transitioning to a new state, trigger appropriate callback events.
18353
18353
  const oldPage = this.state.page;
18354
18354
  const newPage = getCallCompositePage(call, latestEndedCall);
18355
18355
  if (!IsCallEndedPage(oldPage) && IsCallEndedPage(newPage)) {
18356
- this.emitter.emit('callEnded', {
18357
- callId: this.callId
18358
- });
18356
+ this.emitter.emit('callEnded', { callId: this.callId });
18357
+ // Reset the callId to undefined as the call has ended.
18358
+ this.setCurrentCallId(undefined);
18359
+ // Make sure that the call is set to undefined in the state.
18360
+ call = undefined;
18359
18361
  }
18360
18362
  if (this.state.page) {
18361
18363
  this.setState(Object.assign(Object.assign({}, this.state), { userId: clientState.userId, displayName: (_a = clientState.callAgent) === null || _a === void 0 ? void 0 : _a.displayName, call, page: newPage, endedCall: latestEndedCall, devices: clientState.deviceManager, latestErrors: clientState.latestErrors }));
@@ -18575,11 +18577,10 @@ class AzureCommunicationCallAdapter {
18575
18577
  return __awaiter$4(this, void 0, void 0, function* () {
18576
18578
  yield this.handlers.onHangUp(forEveryone);
18577
18579
  this.unsubscribeCallEvents();
18578
- this.call = undefined;
18579
18580
  this.handlers = createDefaultCallingHandlers(this.callClient, this.callAgent, this.deviceManager, undefined);
18580
- this.context.setCurrentCallId(undefined);
18581
- // Resync state after callId is set
18582
- this.context.updateClientState(this.callClient.getState());
18581
+ // We set the adapter.call object to undefined immediately when a call is ended.
18582
+ // We do not set the context.callId to undefined because it is a part of the immutable data flow loop.
18583
+ this.call = undefined;
18583
18584
  this.stopCamera();
18584
18585
  this.mute();
18585
18586
  });