diff --git a/src/pages/cookie/index.tsx b/src/pages/cookie/index.tsx index 7780a447..cdf91d9a 100644 --- a/src/pages/cookie/index.tsx +++ b/src/pages/cookie/index.tsx @@ -196,6 +196,7 @@ const Config = () => { }; const addCookie = () => { + setEditedCookie(null as any); setIsModalVisible(true); }; diff --git a/src/pages/cookie/modal.tsx b/src/pages/cookie/modal.tsx index 80d0f677..dfafb91c 100644 --- a/src/pages/cookie/modal.tsx +++ b/src/pages/cookie/modal.tsx @@ -51,6 +51,8 @@ const CookieModal = ({ useEffect(() => { if (cookie) { form.setFieldsValue({ cookie }); + } else { + form.resetFields(); } }, [cookie]); @@ -58,6 +60,7 @@ const CookieModal = ({ { form .validateFields() diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 1ba411fd..62d3a9b1 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -151,6 +151,7 @@ const Crontab = () => { }; const addCron = () => { + setEditedCron(null as any); setIsModalVisible(true); }; diff --git a/src/pages/crontab/modal.tsx b/src/pages/crontab/modal.tsx index 3cda9730..db1643dd 100644 --- a/src/pages/crontab/modal.tsx +++ b/src/pages/crontab/modal.tsx @@ -39,6 +39,8 @@ const CronModal = ({ useEffect(() => { if (cron) { form.setFieldsValue(cron); + } else { + form.resetFields(); } }, [cron]); @@ -46,6 +48,7 @@ const CronModal = ({ { form .validateFields()