Skip to content

Commit 5fa3131

Browse files
[bugfix] Mobile configuration page enable devices button when camera or microphone is available (#3944)
* Mobile configuration page enable device button when either microphone or camera is available
1 parent 9dec947 commit 5fa3131

3 files changed

Lines changed: 20 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": "LocalPreview",
5+
"comment": "Mobile configuration page enable device button when either microphone or camera is available",
6+
"packageName": "@azure/communication-react",
7+
"email": "edwardlee@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": "LocalPreview",
5+
"comment": "Mobile configuration page enable device button when either microphone or camera is available",
6+
"packageName": "@azure/communication-react",
7+
"email": "edwardlee@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}

packages/react-composites/src/composites/CallComposite/components/LocalPreview.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const LocalPreview = (props: LocalPreviewProps): JSX.Element => {
5454
isLocalMicrophoneEnabled ? adapter.mute() : adapter.unmute();
5555
}, [adapter, isLocalMicrophoneEnabled]);
5656

57+
const hasNoSpeakers = !devicesButtonProps.speakers.length;
5758
const hasNoDevices =
5859
devicesButtonProps.cameras.length === 0 &&
5960
devicesButtonProps.microphones.length === 0 &&
@@ -149,7 +150,7 @@ export const LocalPreview = (props: LocalPreviewProps): JSX.Element => {
149150
data-ui-id="call-composite-local-device-settings-options-button"
150151
{...devicesButtonProps}
151152
// disable button whilst all other buttons are disabled
152-
disabled={!microphonePermissionGranted || !cameraPermissionGranted || hasNoDevices}
153+
disabled={(!microphonePermissionGranted && !cameraPermissionGranted && hasNoSpeakers) || hasNoDevices}
153154
showLabel={true}
154155
// disable tooltip as it obscures list of devices on mobile
155156
strings={props.mobileView ? { tooltipContent: '' } : {}}

0 commit comments

Comments
 (0)