diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 900b7dc2c4..b61563ef5b 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -57,10 +57,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { content: currentFile }) enableAtAddress(true) - } else if (/.(.sol)$/.exec(currentFile) || - /.(.vy)$/.exec(currentFile) || // vyper - /.(.lex)$/.exec(currentFile) || // lexon - /.(.contract)$/.exec(currentFile)) { + } else if (isContractFile(currentFile)) { setAbiLabel({ display: 'none', content: '' @@ -115,6 +112,13 @@ export function ContractDropdownUI (props: ContractDropdownProps) { } } + const isContractFile = (file) => { + return /.(.sol)$/.exec(file) || + /.(.vy)$/.exec(file) || // vyper + /.(.lex)$/.exec(file) || // lexon + /.(.contract)$/.exec(file) + } + const enableAtAddress = (enable: boolean) => { if (enable) { setAtAddressOptions({ @@ -214,7 +218,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {