mirror of
https://github.com/vector-im/element-call.git
synced 2026-01-30 03:15:55 +00:00
Merge pull request #2691 from robintown/duplicate-devices
Remove duplicate media devices from the list
This commit is contained in:
@@ -97,7 +97,11 @@ function useMediaDevice(
|
||||
}
|
||||
|
||||
return {
|
||||
available: available ?? [],
|
||||
available: available
|
||||
? // Sometimes browsers (particularly Firefox) can return multiple
|
||||
// device entries for the exact same device ID; deduplicate them
|
||||
[...new Map(available.map((d) => [d.deviceId, d])).values()]
|
||||
: [],
|
||||
selectedId: alwaysDefault ? undefined : devId,
|
||||
select,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user