diff --git a/src/client/components/modals/monitor/MonitorInfoEditor.tsx b/src/client/components/modals/monitor/MonitorInfoEditor.tsx index e538583..38e074d 100644 --- a/src/client/components/modals/monitor/MonitorInfoEditor.tsx +++ b/src/client/components/modals/monitor/MonitorInfoEditor.tsx @@ -29,6 +29,8 @@ export const MonitorInfoEditor: React.FC = React.memo( (props) => { const [form] = Form.useForm(); const typeValue = Form.useWatch('type', form); + const initialValues = props.initialValues ?? defaultValues; + const isEdit = Boolean(initialValues.id); const formEl = useMemo(() => { const provider = getMonitorProvider(typeValue); @@ -55,13 +57,13 @@ export const MonitorInfoEditor: React.FC = React.memo( preserve={false} form={form} layout="vertical" - initialValues={props.initialValues ?? defaultValues} + initialValues={initialValues} onFinish={handleSubmit} >