From a36cd988c27131eb8f0e1ed57993b65ff2fb6166 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:14:46 +0900 Subject: [PATCH] [bugfix] Config Page: Device. Fix the dropdown label that was possibly undefined. --- .../setting_box/_components/dropdown_menu/DropdownMenu.jsx | 2 ++ src-ui/logics/useReceiveRoutes.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/dropdown_menu/DropdownMenu.jsx b/src-ui/app/config_page/setting_section/setting_box/_components/dropdown_menu/DropdownMenu.jsx index 8b5231c2..423de2ef 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/dropdown_menu/DropdownMenu.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/_components/dropdown_menu/DropdownMenu.jsx @@ -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; diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js index d00edbed..4234fe23 100644 --- a/src-ui/logics/useReceiveRoutes.js +++ b/src-ui/logics/useReceiveRoutes.js @@ -279,6 +279,7 @@ export const useReceiveRoutes = () => { "/set/data/selected_mic_device": updateSelectedMicDevice, "/run/selected_mic_device": (payload) => { + updateSelectedMicHost(payload.host); updateSelectedMicDevice(payload.device); },