Skip to content

Commit

Permalink
fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang authored and Aniket-Engg committed Nov 6, 2024
1 parent 33d14ca commit 6be65c8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ContractGUI(props: ContractGUIProps) {
const multiFields = useRef<Array<HTMLInputElement | null>>([])
const initializeFields = useRef<Array<HTMLInputElement | null>>([])
const basicInputRef = useRef<HTMLInputElement>()
const [checkComplete, setCheckComplete] = useState<boolean>(props.evmCheckComplete)

const intl = useIntl()
useEffect(() => {
if (props.deployOption && Array.isArray(props.deployOption)) {
Expand Down Expand Up @@ -225,12 +225,9 @@ export function ContractGUI(props: ContractGUIProps) {
}
}

useEffect(() => {
setCheckComplete(props.evmCheckComplete)
}, [props.evmCheckComplete])

const handleActionClick = async () => {
props.getVersion()
const compilerState = await props.plugin.call('solidity', 'getCompilerState')

if (props.runTabState.selectExEnv.toLowerCase().startsWith('vm-') || props.runTabState.selectExEnv.toLowerCase().includes('basic-http-provider')) {
await handleDeploy()
Expand All @@ -240,7 +237,9 @@ export function ContractGUI(props: ContractGUIProps) {
props.plugin.call('terminal', 'log', { type: 'log', value: 'Consider opening an issue to update our internal store with your desired chainId.' })
return
}
if (status === 'Passed' && checkComplete) {
const tabState = props.runTabState
const IsCompatible = isChainCompatible(compilerState.evmVersion ?? 'cancun', parseInt(tabState.chainId))
if (status === 'Passed' && IsCompatible) {
await handleDeploy()
}
}
Expand Down

0 comments on commit 6be65c8

Please sign in to comment.