fix(settings): remove hardcoded Default option and add placeholder text
This commit is contained in:
parent
1f96da9381
commit
46d28a0616
2 changed files with 10 additions and 16 deletions
|
|
@ -33,13 +33,10 @@ export const MicrophoneSelector: React.FC<MicrophoneSelectorProps> = React.memo(
|
||||||
await resetSetting("selected_microphone");
|
await resetSetting("selected_microphone");
|
||||||
};
|
};
|
||||||
|
|
||||||
const microphoneOptions = [
|
const microphoneOptions = audioDevices.map(device => ({
|
||||||
{ value: "Default", label: "Default" },
|
value: device.name,
|
||||||
...audioDevices.map(device => ({
|
label: device.name
|
||||||
value: device.name,
|
}));
|
||||||
label: device.name
|
|
||||||
}))
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingContainer
|
<SettingContainer
|
||||||
|
|
@ -53,7 +50,7 @@ export const MicrophoneSelector: React.FC<MicrophoneSelectorProps> = React.memo(
|
||||||
options={microphoneOptions}
|
options={microphoneOptions}
|
||||||
selectedValue={selectedMicrophone}
|
selectedValue={selectedMicrophone}
|
||||||
onSelect={handleMicrophoneSelect}
|
onSelect={handleMicrophoneSelect}
|
||||||
placeholder={isLoading ? "Loading..." : ""}
|
placeholder={isLoading ? "Loading..." : "Select microphone..."}
|
||||||
disabled={isUpdating("selected_microphone") || isLoading}
|
disabled={isUpdating("selected_microphone") || isLoading}
|
||||||
onRefresh={refreshAudioDevices}
|
onRefresh={refreshAudioDevices}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,10 @@ export const OutputDeviceSelector: React.FC<OutputDeviceSelectorProps> = React.m
|
||||||
await resetSetting("selected_output_device");
|
await resetSetting("selected_output_device");
|
||||||
};
|
};
|
||||||
|
|
||||||
const outputDeviceOptions = [
|
const outputDeviceOptions = outputDevices.map(device => ({
|
||||||
{ value: "Default", label: "Default" },
|
value: device.name,
|
||||||
...outputDevices.map(device => ({
|
label: device.name
|
||||||
value: device.name,
|
}));
|
||||||
label: device.name
|
|
||||||
}))
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingContainer
|
<SettingContainer
|
||||||
|
|
@ -54,7 +51,7 @@ export const OutputDeviceSelector: React.FC<OutputDeviceSelectorProps> = React.m
|
||||||
options={outputDeviceOptions}
|
options={outputDeviceOptions}
|
||||||
selectedValue={selectedOutputDevice}
|
selectedValue={selectedOutputDevice}
|
||||||
onSelect={handleOutputDeviceSelect}
|
onSelect={handleOutputDeviceSelect}
|
||||||
placeholder={isLoading ? "Loading..." : ""}
|
placeholder={isLoading ? "Loading..." : "Select output device..."}
|
||||||
disabled={isUpdating("selected_output_device") || isLoading}
|
disabled={isUpdating("selected_output_device") || isLoading}
|
||||||
onRefresh={refreshOutputDevices}
|
onRefresh={refreshOutputDevices}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue