Skip to content

Commit 59c4d24

Browse files
[TDL bug fix] Camera bad state in lobby page (#3876)
* dispose unparented view on lobby or connected * Change files * Duplicate change files for beta release * Update packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com> Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> * fix lint --------- Signed-off-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com> Co-authored-by: James Burnside <2684369+JamesBurnside@users.noreply.github.com>
1 parent 2c4cdd2 commit 59c4d24

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Bug fix",
5+
"comment": "Dispose of the unparented views when we hit a state that has us actually in a call",
6+
"packageName": "@azure/communication-react",
7+
"email": "94866715+dmceachernmsft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Bug fix",
5+
"comment": "Dispose of the unparented views when we hit a state that has us actually in a call",
6+
"packageName": "@azure/communication-react",
7+
"email": "94866715+dmceachernmsft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,16 @@ export class AzureCommunicationCallAdapter<AgentType extends CallAgent | BetaTea
409409
this.context.setCurrentCallId(this.call.id);
410410
}
411411

412+
// If the call connects we need to clean up any previous unparentedViews
413+
if (
414+
(this.call?.state === 'InLobby' || this.call?.state === 'Connected') &&
415+
this.callClient.getState().deviceManager.unparentedViews.length > 0
416+
) {
417+
this.callClient.getState().deviceManager.unparentedViews.forEach((view) => {
418+
this.callClient.disposeView(undefined, undefined, view);
419+
});
420+
}
421+
412422
this.context.updateClientState(clientState);
413423

414424
/* @conditional-compile-remove(call-transfer) */

0 commit comments

Comments
 (0)