pull/5381/head
Joseph Izang 2 weeks ago committed by Aniket
parent f799ca6fc4
commit ead3ee0bc6
  1. 9
      libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
  2. 1
      libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx
  3. 2
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx
  4. 6
      libs/remix-ui/run-tab/src/lib/run-tab.tsx
  5. 2
      libs/remix-ui/run-tab/src/lib/types/index.ts

@ -32,6 +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)) {
@ -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()
}
}

@ -64,6 +64,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
getVersion={props.getVersion}
getCompilerDetails={props.getCompilerDetails}
runTabState={props.runTabState}
evmCheckComplete={props.evmCheckComplete}
/>
)
})}

@ -327,7 +327,7 @@ export function UniversalDappUI(props: UdappProps) {
<ContractGUI
getVersion={props.getVersion}
getCompilerDetails={props.getCompilerDetails}
evmCheckComplete={false}
evmCheckComplete={props.evmCheckComplete}
plugin={props.plugin}
runTabState={props.runTabState}
funcABI={funcABI}

@ -138,7 +138,6 @@ export function RunTabUI(props: RunTabProps) {
const IsCompatible = isChainCompatible(ideDefault, targetChainId)
const chain = await returnCompatibleChain(ideDefault, targetChainId)
if (chain === undefined) {
//show modal
plugin.call('terminal', 'log', { type: 'log', value: 'No compatible chain found for the selected EVM version.' })
return 'Failed'
} else {
@ -161,9 +160,11 @@ export function RunTabUI(props: RunTabProps) {
okFn: () => checkEvmChainCompatibilityOkFunction(chain),
cancelFn: () => {}
})
return 'Failed'
} else {
return 'Passed'
}
}
return 'Passed'
}
}
@ -418,6 +419,7 @@ export function RunTabUI(props: RunTabProps) {
<InstanceContainerUI
plugin={plugin}
getCompilerDetails={getCompilerDetails}
evmCheckComplete={evmCheckComplete}
runTabState={runTab}
instances={runTab.instances}
clearInstances={removeInstances}

@ -303,6 +303,7 @@ export interface RecorderProps {
export interface InstanceContainerProps {
getCompilerDetails: () => Promise<CheckStatus>
evmCheckComplete?: boolean
runTabState: RunTabState
instances: {
instanceList: {
@ -430,6 +431,7 @@ export interface MainnetProps {
export interface UdappProps {
getCompilerDetails: () => Promise<CheckStatus>
evmCheckComplete?: boolean,
runTabState: RunTabState
instance: {
contractData?: ContractData,

Loading…
Cancel
Save