From eb2de869b8098122e188a3c8e66aca0b2ea75a6b Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 7 Jul 2022 10:18:11 +0200 Subject: [PATCH] Prevent empty device labels Fixes: #324 Signed-off-by: Johannes Marbach --- src/settings/SettingsModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/settings/SettingsModal.tsx b/src/settings/SettingsModal.tsx index 1e45d55..90e4e46 100644 --- a/src/settings/SettingsModal.tsx +++ b/src/settings/SettingsModal.tsx @@ -78,7 +78,7 @@ export const SettingsModal = (props: Props) => { onSelectionChange={setAudioInput} > {audioInputs.map(({ deviceId, label }) => ( - {label} + {!!label && label.trim().length > 0 ? label : "Default microphone"} ))} {audioOutputs.length > 0 && ( @@ -88,7 +88,7 @@ export const SettingsModal = (props: Props) => { onSelectionChange={setAudioOutput} > {audioOutputs.map(({ deviceId, label }) => ( - {label} + {!!label && label.trim().length > 0 ? label : "Default speaker"} ))} )} @@ -119,7 +119,7 @@ export const SettingsModal = (props: Props) => { onSelectionChange={setVideoInput} > {videoInputs.map(({ deviceId, label }) => ( - {label} + {!!label && label.trim().length > 0 ? label : "Default camera"} ))}