diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 499af9a264..262ffd3aba 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -83,18 +83,18 @@ export function RunTabUI(props: RunTabProps) { const [solcVersion, setSolcVersion] = useState<{version: string, canReceive: boolean}>({ version: '', canReceive: true }) const getVersion = () => { - let version = '' + let version = '0.8.25' try { - version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) ?? 'v0.8.25' + version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) ?? '0.8.25' if (parseFloat(version) < 0.6) { setSolcVersion({ version: version, canReceive: false }) + } else { + setSolcVersion({ version: version, canReceive: true }) } - setSolcVersion({ version: version, canReceive: true }) } catch (e) { - version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1) ?? 'v0.8.25' + setSolcVersion({ version, canReceive: true }) console.log(e) } - return version } useEffect(() => { diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 39c8fd5781..c5b7efa94e 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -283,7 +283,7 @@ export interface ContractDropdownProps { setCompilerVersion: React.Dispatch> - getCompilerVersion: () => string + getCompilerVersion: () => void } export interface RecorderProps { @@ -349,7 +349,7 @@ export interface InstanceContainerProps { editInstance: (instance) => void plugin: RunTab solcVersion: { version: string, canReceive: boolean } - getVersion: () => string + getVersion: any } export interface Modal { @@ -408,7 +408,7 @@ export interface ContractGUIProps { setSolcVersion?: React.Dispatch> - getVersion: () => string + getVersion: () => void } export interface MainnetProps { network: Network,