|
|
@ -71,11 +71,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
enableContractNames(false) |
|
|
|
enableContractNames(false) |
|
|
|
setCompFails('block') |
|
|
|
setCompFails('block') |
|
|
|
} |
|
|
|
} |
|
|
|
if (contractList.length > 0) { |
|
|
|
initSelectedContract() |
|
|
|
const contract = contractList.find(contract => contract.alias === selectedContract) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!selectedContract || !contract) setSelectedContract(contractList[0].alias) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, [loadType, currentFile]) |
|
|
|
}, [loadType, currentFile]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -91,6 +87,18 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [selectedContract]) |
|
|
|
}, [selectedContract]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
initSelectedContract() |
|
|
|
|
|
|
|
}, [contractList]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initSelectedContract = () => { |
|
|
|
|
|
|
|
if (contractList.length > 0) { |
|
|
|
|
|
|
|
const contract = contractList.find(contract => contract.alias === selectedContract) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!selectedContract || !contract) setSelectedContract(contractList[0].alias) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const enableAtAddress = (enable: boolean) => { |
|
|
|
const enableAtAddress = (enable: boolean) => { |
|
|
|
if (enable) { |
|
|
|
if (enable) { |
|
|
|
setAtAddressOptions({ |
|
|
|
setAtAddressOptions({ |
|
|
@ -119,8 +127,8 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const clickCallback = (inputsValues) => { |
|
|
|
const clickCallback = (inputs, value) => { |
|
|
|
createInstance(loadedContractData, inputsValues) |
|
|
|
createInstance(loadedContractData, value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const createInstance = (selectedContract, args) => { |
|
|
|
const createInstance = (selectedContract, args) => { |
|
|
|