chore: Ensure device provider lists have at least one listed device (#36983)

pull/36967/head^2
gabriellsh 4 months ago committed by GitHub
parent c5d48796fc
commit 050f1dc393
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      apps/meteor/client/providers/DeviceProvider/DeviceProvider.tsx

@ -70,9 +70,12 @@ export const DeviceProvider = ({ children }: DeviceProviderProps): ReactElement
type: device.kind,
}));
const audioInput = mappedDevices.filter((device) => device.type === 'audioinput');
const filteredInput = mappedDevices.filter((device) => device.type === 'audioinput');
const audioOutput = mappedDevices.filter((device) => device.type === 'audiooutput');
const filteredOutput = mappedDevices.filter((device) => device.type === 'audiooutput');
const audioInput = filteredInput.length > 0 ? filteredInput : [defaultDevices.defaultAudioInputDevice];
const audioOutput = filteredOutput.length > 0 ? filteredOutput : [defaultDevices.defaultAudioOutputDevice];
return {
audioInput,

Loading…
Cancel
Save