fixes to getVersion function

pull/4841/head
Joseph Izang 5 months ago
parent e6eec05471
commit b4e6865c0d
  1. 10
      libs/remix-ui/run-tab/src/lib/run-tab.tsx
  2. 6
      libs/remix-ui/run-tab/src/lib/types/index.ts

@ -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(() => {

@ -283,7 +283,7 @@ export interface ContractDropdownProps {
setCompilerVersion: React.Dispatch<React.SetStateAction<{
version: string;
canReceive: boolean;}>>
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<React.SetStateAction<{
version: string;
canReceive: boolean;}>>
getVersion: () => string
getVersion: () => void
}
export interface MainnetProps {
network: Network,

Loading…
Cancel
Save