Merge pull request #5131 from matrix-org/dbkr/clarify_media_device_id

Add clarifying comment in media device selection
This commit is contained in:
David Baker 2020-08-20 09:26:27 +01:00 committed by GitHub
commit 0690c02e0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,6 +157,9 @@ export default class VoiceUserSettingsTab extends React.Component {
label: _t('Default Device'),
};
const getDefaultDevice = (devices) => {
// Note we're looking for a device with deviceId 'default' but adding a device
// with deviceId == the empty string: this is because Chrome gives us a device
// with deviceId 'default', so we're looking for this, not the one we are adding.
if (!devices.some((i) => i.deviceId === 'default')) {
devices.unshift(defaultOption);
return '';