mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:32:51 +00:00
chore: fix typo (#4589)
This commit is contained in:
parent
6bc8a093ad
commit
056a126d3a
@ -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>
|
||||
);
|
||||
|
@ -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} />;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user