chore: fix typo (#4589)

This commit is contained in:
Zeke Zhang 2024-06-08 09:16:13 +08:00 committed by GitHub
parent 6bc8a093ad
commit 056a126d3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ import React, { createContext, useContext, useState } from 'react';
const TemplateBlockContext = createContext<{
// 模板是否已经请求结束
templateFinshed?: boolean;
templateFinished?: boolean;
onTemplateSuccess?: Function;
}>({});
TemplateBlockContext.displayName = 'TemplateBlockContext';
@ -24,9 +24,9 @@ export const useTemplateBlockContext = () => {
};
const TemplateBlockProvider = (props) => {
const [templateFinshed, setTemplateFinshed] = useState(false);
const [templateFinished, setTemplateFinished] = useState(false);
return (
<TemplateBlockContext.Provider value={{ templateFinshed, onTemplateSuccess: () => setTemplateFinshed(true) }}>
<TemplateBlockContext.Provider value={{ templateFinished, onTemplateSuccess: () => setTemplateFinished(true) }}>
{props.children}
</TemplateBlockContext.Provider>
);

View File

@ -117,7 +117,7 @@ const WithForm = (props: WithFormProps) => {
const { setFormValueChanged } = useActionContext();
const variables = useVariables();
const localVariables = useLocalVariables({ currentForm: form });
const { templateFinshed } = useTemplateBlockContext();
const { templateFinished } = useTemplateBlockContext();
const linkageRules: any[] =
(getLinkageRules(fieldSchema) || fieldSchema.parent?.['x-linkage-rules'])?.filter((k) => !k.disabled) || [];
@ -196,7 +196,7 @@ const WithForm = (props: WithFormProps) => {
dispose();
});
};
}, [linkageRules, templateFinshed]);
}, [linkageRules, templateFinished]);
return fieldSchema['x-decorator'] === 'FormV2' ? <FormDecorator {...props} /> : <FormComponent {...props} />;
};