From be7e77787ee9af7dafcd50c49f0bf5b86c528b63 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:08:32 +0900 Subject: [PATCH] [Update] Config Page: Device Tab. Threshold section. Add validation that when input area to be blank, put 0 automatically. --- .../threshold_entry/ThresholdEntry.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src-ui/app/config_page/setting_section/setting_box/components/threshold_component/threshold_entry/ThresholdEntry.jsx b/src-ui/app/config_page/setting_section/setting_box/components/threshold_component/threshold_entry/ThresholdEntry.jsx index a464c7ea..9b5b5e62 100644 --- a/src-ui/app/config_page/setting_section/setting_box/components/threshold_component/threshold_entry/ThresholdEntry.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/components/threshold_component/threshold_entry/ThresholdEntry.jsx @@ -15,7 +15,11 @@ export const ThresholdEntry = (props) => { const ThresholdEntry_Mic = (props) => { const onChangeFunction = (e) => { - props.setThresholdFunction(e.currentTarget.value); + if (e.currentTarget.value === "") { + props.setThresholdFunction("0"); + } else { + props.setThresholdFunction(e.currentTarget.value); + } }; return ( @@ -29,7 +33,11 @@ const ThresholdEntry_Mic = (props) => { const ThresholdEntry_Speaker = (props) => { const onChangeFunction = (e) => { - props.setThresholdFunction(e.currentTarget.value); + if (e.currentTarget.value === "") { + props.setThresholdFunction("0"); + } else { + props.setThresholdFunction(e.currentTarget.value); + } }; return (