fix(devices): Do not select stored devices that are not available.

pull/15099/head jitsi-meet_9718
Hristo Terezov 9 months ago
parent d2afd5e54d
commit 0fa02ff6ba
  1. 22
      react/features/base/settings/functions.web.ts

@ -178,18 +178,20 @@ function _getUserSelectedDeviceId(options: {
replacement = ''
} = options;
// If there is no label at all, there is no need to fall back to checking
// the label for a fuzzy match.
if (!userSelectedDeviceLabel || !userSelectedDeviceId) {
return userSelectedDeviceId;
}
if (userSelectedDeviceId) {
const foundMatchingBasedonDeviceId = availableDevices?.find(
candidate => candidate.deviceId === userSelectedDeviceId);
const foundMatchingBasedonDeviceId = availableDevices?.find(
candidate => candidate.deviceId === userSelectedDeviceId);
// Prioritize matching the deviceId
if (foundMatchingBasedonDeviceId) {
return userSelectedDeviceId;
}
}
// Prioritize matching the deviceId
if (foundMatchingBasedonDeviceId) {
return userSelectedDeviceId;
// If there is no label at all, there is no need to fall back to checking
// the label for a fuzzy match.
if (!userSelectedDeviceLabel) {
return;
}
const strippedDeviceLabel

Loading…
Cancel
Save