From fb790e5e379b85b59f6efa5cb4974d7722822830 Mon Sep 17 00:00:00 2001 From: Antony Kurniawan Date: Fri, 12 Dec 2025 16:54:52 +0700 Subject: [PATCH] repair: error code brand-device --- .../brandDevice/component/ErrorCodeForm.jsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/master/brandDevice/component/ErrorCodeForm.jsx b/src/pages/master/brandDevice/component/ErrorCodeForm.jsx index 666e3b1..2030332 100644 --- a/src/pages/master/brandDevice/component/ErrorCodeForm.jsx +++ b/src/pages/master/brandDevice/component/ErrorCodeForm.jsx @@ -15,8 +15,8 @@ const ErrorCodeForm = ({ onErrorCodeIconRemove, isEdit = false, }) => { - const [statusValue, setStatusValue] = useState(true); const [currentIcon, setCurrentIcon] = useState(null); + const statusWatch = Form.useWatch('status', errorCodeForm) ?? true; useEffect(() => { if (errorCodeIcon && typeof errorCodeIcon === 'object' && Object.keys(errorCodeIcon).length > 0) { @@ -207,14 +207,13 @@ const ErrorCodeForm = ({ valuePropName="checked" >
- { - setStatusValue(checked); - }} - /> + + + - {statusValue ? 'Active' : 'Inactive'} + {statusWatch ? 'Active' : 'Inactive'}