mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 08:21:53 +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<{
|
const TemplateBlockContext = createContext<{
|
||||||
// 模板是否已经请求结束
|
// 模板是否已经请求结束
|
||||||
templateFinshed?: boolean;
|
templateFinished?: boolean;
|
||||||
onTemplateSuccess?: Function;
|
onTemplateSuccess?: Function;
|
||||||
}>({});
|
}>({});
|
||||||
TemplateBlockContext.displayName = 'TemplateBlockContext';
|
TemplateBlockContext.displayName = 'TemplateBlockContext';
|
||||||
@ -24,9 +24,9 @@ export const useTemplateBlockContext = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const TemplateBlockProvider = (props) => {
|
const TemplateBlockProvider = (props) => {
|
||||||
const [templateFinshed, setTemplateFinshed] = useState(false);
|
const [templateFinished, setTemplateFinished] = useState(false);
|
||||||
return (
|
return (
|
||||||
<TemplateBlockContext.Provider value={{ templateFinshed, onTemplateSuccess: () => setTemplateFinshed(true) }}>
|
<TemplateBlockContext.Provider value={{ templateFinished, onTemplateSuccess: () => setTemplateFinished(true) }}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</TemplateBlockContext.Provider>
|
</TemplateBlockContext.Provider>
|
||||||
);
|
);
|
||||||
|
@ -117,7 +117,7 @@ const WithForm = (props: WithFormProps) => {
|
|||||||
const { setFormValueChanged } = useActionContext();
|
const { setFormValueChanged } = useActionContext();
|
||||||
const variables = useVariables();
|
const variables = useVariables();
|
||||||
const localVariables = useLocalVariables({ currentForm: form });
|
const localVariables = useLocalVariables({ currentForm: form });
|
||||||
const { templateFinshed } = useTemplateBlockContext();
|
const { templateFinished } = useTemplateBlockContext();
|
||||||
const linkageRules: any[] =
|
const linkageRules: any[] =
|
||||||
(getLinkageRules(fieldSchema) || fieldSchema.parent?.['x-linkage-rules'])?.filter((k) => !k.disabled) || [];
|
(getLinkageRules(fieldSchema) || fieldSchema.parent?.['x-linkage-rules'])?.filter((k) => !k.disabled) || [];
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ const WithForm = (props: WithFormProps) => {
|
|||||||
dispose();
|
dispose();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}, [linkageRules, templateFinshed]);
|
}, [linkageRules, templateFinished]);
|
||||||
|
|
||||||
return fieldSchema['x-decorator'] === 'FormV2' ? <FormDecorator {...props} /> : <FormComponent {...props} />;
|
return fieldSchema['x-decorator'] === 'FormV2' ? <FormDecorator {...props} /> : <FormComponent {...props} />;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user