Skip to content

Commit 8ba171e

Browse files
[End Call Options] End call for everyone only for when the user is connected (#4768)
* only show menu button for Connected state * Change files * fix state fetch
1 parent 82c162c commit 8ba171e

3 files changed

Lines changed: 22 additions & 1 deletion

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": "End call options",
5+
"comment": "Only allow the user to end the call for everyone if they are acitvely in the call",
6+
"packageName": "@azure/communication-react",
7+
"email": "dmceachern@microsoft.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": "End call options",
5+
"comment": "Only allow the user to end the call for everyone if they are acitvely in the call",
6+
"packageName": "@azure/communication-react",
7+
"email": "dmceachern@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/common/ControlBar/CommonCallControlBar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,10 @@ export const CommonCallControlBar = (props: CommonCallControlBarProps & Containe
466466
!props.mobileView &&
467467
isHangUpForEveryoneAllowed &&
468468
!isTeams && // Temporary disable it for Teams call, since capability does not give the right value
469-
props.callControls?.endCallButton?.hangUpForEveryone === 'endCallOptions'
469+
props.callControls?.endCallButton?.hangUpForEveryone === 'endCallOptions' &&
470+
// Only show the end call menu when the call is connected, user should not be able to end the call for everyone
471+
// when they are not actively in the call to communicate they will.
472+
callState.callStatus === 'Connected'
470473
}
471474
/>
472475
</ControlBar>

0 commit comments

Comments
 (0)