From d4a79b41c85d8e32e64456647b48297aee8be5c2 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Thu, 15 Dec 2022 09:40:10 +0800 Subject: [PATCH] refactor(customize): Optimization of custom settings update --- ui/src/pages/Admin/CssAndHtml/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/src/pages/Admin/CssAndHtml/index.tsx b/ui/src/pages/Admin/CssAndHtml/index.tsx index f2ec26dd..e309ae50 100644 --- a/ui/src/pages/Admin/CssAndHtml/index.tsx +++ b/ui/src/pages/Admin/CssAndHtml/index.tsx @@ -6,6 +6,7 @@ import { getPageCustom, putPageCustom } from '@/services'; import { SchemaForm, JSONSchema, initFormData, UISchema } from '@/components'; import { useToast } from '@/hooks'; import { handleFormError } from '@/utils'; +import { customizeStore } from '@/stores'; const Index: FC = () => { const { t } = useTranslation('translation', { @@ -68,7 +69,6 @@ const Index: FC = () => { }, }; const [formData, setFormData] = useState(initFormData(schema)); - const onSubmit = (evt) => { evt.preventDefault(); evt.stopPropagation(); @@ -86,9 +86,7 @@ const Index: FC = () => { msg: t('update', { keyPrefix: 'toast' }), variant: 'success', }); - setTimeout(() => { - window.location.reload(); - }, 3000); + customizeStore.getState().update(reqParams); }) .catch((err) => { if (err.isError) {