diff --git a/src/pages/master/brandDevice/component/BrandForm.jsx b/src/pages/master/brandDevice/component/BrandForm.jsx
index 42365c4..046045b 100644
--- a/src/pages/master/brandDevice/component/BrandForm.jsx
+++ b/src/pages/master/brandDevice/component/BrandForm.jsx
@@ -4,6 +4,8 @@ import { Form, Input, Row, Col, Typography, Switch } from 'antd';
const { Text } = Typography;
const BrandForm = ({ form, formData, onValuesChange, isEdit = false }) => {
+ const isActive = Form.useWatch('is_active', form) ?? formData.is_active ?? true;
+
return (
-
- prevValues[`solution_status_${fieldId}`] !==
- currentValues[`solution_status_${fieldId}`]
- }
- noStyle
- >
- {({ getFieldValue, setFieldValue }) => {
- const currentStatus = getFieldValue(`solution_status_${fieldId}`);
- return (
-
- {
- setFieldValue(`solution_status_${fieldId}`, checked);
- }}
- disabled={isReadOnly}
- style={{
- backgroundColor: solutionStatus ? '#23A55A' : '#bfbfbf',
- }}
- />
-
- {currentStatus === true ? 'Active' : 'Non Active'}
-
-
- );
- }}
-
+
+
+ {
+ onSolutionStatusChange(fieldId, checked);
+ }}
+ style={{
+ backgroundColor: (watchedStatus ?? true) ? '#23A55A' : '#bfbfbf',
+ }}
+ />
+
+
+ {(watchedStatus ?? true) ? 'Active' : 'Non Active'}
+
+
diff --git a/src/pages/master/brandDevice/hooks/errorCode.js b/src/pages/master/brandDevice/hooks/errorCode.js
index f1d3e9f..0d748d5 100644
--- a/src/pages/master/brandDevice/hooks/errorCode.js
+++ b/src/pages/master/brandDevice/hooks/errorCode.js
@@ -194,9 +194,7 @@ export const useErrorCodeLogic = (errorCodeForm, fileList) => {
};
const handleSolutionStatusChange = (fieldId, status) => {
- // Update form immediately
- errorCodeForm.setFieldValue(`solution_status_${fieldId}`, status);
- // Then update local state
+ // Only update local state - form is already updated by Form.Item
setSolutionStatuses(prev => ({
...prev,
[fieldId]: status