Merge pull request #449 from Johennes/feature/no-empty-labels
Prevent empty device labels
This commit is contained in:
commit
4dcec504ca
1 changed files with 18 additions and 6 deletions
|
@ -77,8 +77,12 @@ export const SettingsModal = (props: Props) => {
|
||||||
selectedKey={audioInput}
|
selectedKey={audioInput}
|
||||||
onSelectionChange={setAudioInput}
|
onSelectionChange={setAudioInput}
|
||||||
>
|
>
|
||||||
{audioInputs.map(({ deviceId, label }) => (
|
{audioInputs.map(({ deviceId, label }, index) => (
|
||||||
<Item key={deviceId}>{label}</Item>
|
<Item key={deviceId}>
|
||||||
|
{!!label && label.trim().length > 0
|
||||||
|
? label
|
||||||
|
: `Microphone ${index + 1}`}
|
||||||
|
</Item>
|
||||||
))}
|
))}
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
{audioOutputs.length > 0 && (
|
{audioOutputs.length > 0 && (
|
||||||
|
@ -87,8 +91,12 @@ export const SettingsModal = (props: Props) => {
|
||||||
selectedKey={audioOutput}
|
selectedKey={audioOutput}
|
||||||
onSelectionChange={setAudioOutput}
|
onSelectionChange={setAudioOutput}
|
||||||
>
|
>
|
||||||
{audioOutputs.map(({ deviceId, label }) => (
|
{audioOutputs.map(({ deviceId, label }, index) => (
|
||||||
<Item key={deviceId}>{label}</Item>
|
<Item key={deviceId}>
|
||||||
|
{!!label && label.trim().length > 0
|
||||||
|
? label
|
||||||
|
: `Speaker ${index + 1}`}
|
||||||
|
</Item>
|
||||||
))}
|
))}
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
)}
|
)}
|
||||||
|
@ -118,8 +126,12 @@ export const SettingsModal = (props: Props) => {
|
||||||
selectedKey={videoInput}
|
selectedKey={videoInput}
|
||||||
onSelectionChange={setVideoInput}
|
onSelectionChange={setVideoInput}
|
||||||
>
|
>
|
||||||
{videoInputs.map(({ deviceId, label }) => (
|
{videoInputs.map(({ deviceId, label }, index) => (
|
||||||
<Item key={deviceId}>{label}</Item>
|
<Item key={deviceId}>
|
||||||
|
{!!label && label.trim().length > 0
|
||||||
|
? label
|
||||||
|
: `Camera ${index + 1}`}
|
||||||
|
</Item>
|
||||||
))}
|
))}
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
Loading…
Add table
Reference in a new issue