[bugfix] Config Page: Device. Fix the dropdown label that was possibly undefined.

This commit is contained in:
Sakamoto Shiina
2024-12-26 16:14:46 +09:00
parent 648e0d954a
commit a36cd988c2
2 changed files with 3 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ export const DropdownMenu = (props) => {
const getSelectedText = () => {
if (props.state !== "ok") return;
if (props.list[props.selected_id] === undefined) return props.selected_id; // [Fix me]
return props.list[props.selected_id];
};
const list = (props.list === undefined) ? {} : props.list;

View File

@@ -279,6 +279,7 @@ export const useReceiveRoutes = () => {
"/set/data/selected_mic_device": updateSelectedMicDevice,
"/run/selected_mic_device": (payload) => {
updateSelectedMicHost(payload.host);
updateSelectedMicDevice(payload.device);
},