From 29e751756615078fb452e10b0c9cd5eb46de468e Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 7 Jul 2022 12:21:20 +0530 Subject: [PATCH] fix contract dropdown in UDApp --- .../src/lib/components/contractDropdownUI.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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) {
- { (contractList[currentFile] || []).map((contract, index) => { return }) } @@ -258,7 +262,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
: '' }
-
or
+
or