diff --git a/src/app/features/call/CallDevicePreview.tsx b/src/app/features/call/CallDevicePreview.tsx index c5573c0a1..2d2178b2c 100644 --- a/src/app/features/call/CallDevicePreview.tsx +++ b/src/app/features/call/CallDevicePreview.tsx @@ -10,11 +10,12 @@ type DeviceSelectProps = { kind: MediaDeviceKind; deviceId?: string; onChange: (deviceId: string) => void; - permissionsGranted: boolean; + hasTrack: boolean; }; -function DeviceSelect({ label, kind, deviceId, onChange, permissionsGranted }: DeviceSelectProps) { - const { devices } = useMediaDeviceSelect({ kind, requestPermissions: permissionsGranted }); +function DeviceSelect({ label, kind, deviceId, onChange, hasTrack }: DeviceSelectProps) { + const { devices } = useMediaDeviceSelect({ kind, requestPermissions: hasTrack }); + const namedDevices = devices.filter((device) => device.deviceId !== ''); return ( @@ -26,7 +27,7 @@ function DeviceSelect({ label, kind, deviceId, onChange, permissionsGranted }: D onChange={(event) => onChange(event.target.value)} > - {devices.map((device, index) => ( + {namedDevices.map((device, index) => ( @@ -126,14 +127,14 @@ export function CallDevicePreview({ kind="audioinput" deviceId={audioDeviceId} onChange={onAudioDeviceChange} - permissionsGranted={microphone} + hasTrack={!!audioTrack} />