You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
provide default for missing device labels
This commit is contained in:
@@ -100,7 +100,17 @@ export default class VoiceUserSettingsTab extends React.Component {
|
||||
};
|
||||
|
||||
_renderDeviceOptions(devices, category) {
|
||||
return devices.map((d) => <option key={`${category}-${d.deviceId}`} value={d.deviceId}>{d.label}</option>);
|
||||
return devices.map((d) => {
|
||||
let label = d.label;
|
||||
if (!label) {
|
||||
switch (d.kind) {
|
||||
case "audioinput": label = _t("Unnamed microphone"); break;
|
||||
case "audiooutput": label = _t("Unnamed audio output"); break;
|
||||
case "videoinput": label = _t("Unnamed camera"); break;
|
||||
}
|
||||
}
|
||||
return (<option key={`${category}-${d.deviceId}`} value={d.deviceId}>{label}</option>);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user