From fbc97cdd7674293e0952514cfdf5fe5c72e14245 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 2 Jan 2023 10:21:57 +0100 Subject: [PATCH] cache result --- libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index 402cb3c414..093b0f3d26 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -208,7 +208,8 @@ export const ContractSelection = (props: ContractSelectionProps) => { try { const currentFile = api.currentFile const ast = content4AST.length > 1 ? parser.parse(content4AST) : parser.parse(api.getCompilationResult().source.sources[currentFile].content) - setSVGPayload(vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, currentFile)))) + const payload = vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, currentFile))) + setSVGPayload(payload) setShowViewer(!showViewer) } catch (error) { console.log({ error })