fix: variable value is lost after refreshing markdown block popup (#5478)

This commit is contained in:
Katherine 2024-10-22 11:29:32 +08:00 committed by GitHub
parent f0abab4ad0
commit fc79c4397a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,15 +150,16 @@ export const MarkdownVoid: any = withDynamicSchemaProps(
useEffect(() => { useEffect(() => {
setLoading(true); setLoading(true);
const cvtContentToHTML = async () => { const cvtContentToHTML = async () => {
const replacedContent = await getRenderContent( setTimeout(async () => {
engine, const replacedContent = await getRenderContent(
content, engine,
compile(variables), content,
compile(localVariables), compile(variables),
parseMarkdown, compile(localVariables),
); parseMarkdown,
);
setHtml(replacedContent); setHtml(replacedContent);
});
setLoading(false); setLoading(false);
}; };
cvtContentToHTML(); cvtContentToHTML();