From fc79c4397a80f3e6d784abd311f0e4f4ea60eb95 Mon Sep 17 00:00:00 2001 From: Katherine Date: Tue, 22 Oct 2024 11:29:32 +0800 Subject: [PATCH] fix: variable value is lost after refreshing markdown block popup (#5478) --- .../antd/markdown/Markdown.Void.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/markdown/Markdown.Void.tsx b/packages/core/client/src/schema-component/antd/markdown/Markdown.Void.tsx index eb9a7e5055..f840953a82 100644 --- a/packages/core/client/src/schema-component/antd/markdown/Markdown.Void.tsx +++ b/packages/core/client/src/schema-component/antd/markdown/Markdown.Void.tsx @@ -150,15 +150,16 @@ export const MarkdownVoid: any = withDynamicSchemaProps( useEffect(() => { setLoading(true); const cvtContentToHTML = async () => { - const replacedContent = await getRenderContent( - engine, - content, - compile(variables), - compile(localVariables), - parseMarkdown, - ); - - setHtml(replacedContent); + setTimeout(async () => { + const replacedContent = await getRenderContent( + engine, + content, + compile(variables), + compile(localVariables), + parseMarkdown, + ); + setHtml(replacedContent); + }); setLoading(false); }; cvtContentToHTML();