diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 71904b4850..decfde25da 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -32,6 +32,7 @@ export function ContractGUI(props: ContractGUIProps) { const multiFields = useRef>([]) const initializeFields = useRef>([]) const basicInputRef = useRef() + const [checkComplete, setCheckComplete] = useState(props.evmCheckComplete) const intl = useIntl() useEffect(() => { if (props.deployOption && Array.isArray(props.deployOption)) { @@ -224,10 +225,16 @@ export function ContractGUI(props: ContractGUIProps) { } } + useEffect(() => { + setCheckComplete(props.evmCheckComplete) + }, [props.evmCheckComplete]) + const handleActionClick = async () => { props.getVersion() if (props.runTabState.selectExEnv.toLowerCase().startsWith('vm-') || props.runTabState.selectExEnv.toLowerCase().includes('basic-http-provider')) { + const tabState = props.runTabState + console.log('checkComplete and status', { tabState }) await handleDeploy() } else { const status = await props.getCompilerDetails() @@ -235,7 +242,7 @@ 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 (props.evmCheckComplete) { + if (status === 'Passed' && checkComplete) { await handleDeploy() } } diff --git a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx index f562330ce6..f247f030e9 100644 --- a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx @@ -64,6 +64,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) { getVersion={props.getVersion} getCompilerDetails={props.getCompilerDetails} runTabState={props.runTabState} + evmCheckComplete={props.evmCheckComplete} /> ) })} diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 18ed81d463..738bbbbc14 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -327,7 +327,7 @@ export function UniversalDappUI(props: UdappProps) { checkEvmChainCompatibilityOkFunction(chain), cancelFn: () => {} }) + return 'Failed' + } else { + return 'Passed' } } - return 'Passed' } } @@ -418,6 +419,7 @@ export function RunTabUI(props: RunTabProps) { Promise + evmCheckComplete?: boolean runTabState: RunTabState instances: { instanceList: { @@ -430,6 +431,7 @@ export interface MainnetProps { export interface UdappProps { getCompilerDetails: () => Promise + evmCheckComplete?: boolean, runTabState: RunTabState instance: { contractData?: ContractData,