From 21fbbe3a4b9611e261fde442d40c663e147050c6 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 12 Oct 2022 19:55:40 +0530 Subject: [PATCH] reload builtin version --- .../solidity-compiler/src/lib/compiler-container.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 1745306755..6b470702e1 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -319,7 +319,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => { isURL = true selectedVersion = versionFromURL } - } else { + } else if (versionFromURL === 'builtin') selectedVersion = 'builtin' + else { // URL version can be like 0.8.7+commit.e28d00a7, 0.8.7 or soljson-v0.8.7+commit.e28d00a7.js const selectedVersionArr = versions.filter(obj => obj.path === versionFromURL || obj.longVersion === versionFromURL || obj.version === versionFromURL) // for version like 0.8.15, there will be more than one elements in the array @@ -557,8 +558,10 @@ export const CompilerContainer = (props: CompilerContainerProps) => { // Workers cannot load js on "file:"-URLs and we get a // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // resort to non-worker version in that case. - if (selectedVersion === 'builtin') selectedVersion = state.defaultVersion - if (selectedVersion !== 'builtin' && canUseWorker(selectedVersion)) { + if (selectedVersion === 'builtin') { + compileTabLogic.compiler.loadVersion(false, url) + } + else if (selectedVersion !== 'builtin' && canUseWorker(selectedVersion)) { compileTabLogic.compiler.loadVersion(true, url) } else { compileTabLogic.compiler.loadVersion(false, url)