Skip to content

Commit faca71e

Browse files
author
ci-bot
committed
Add network-aware contract verification and fix test failures.
1 parent 93e169b commit faca71e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,24 @@ export function ContractDropdownUI(props: ContractDropdownProps) {
4242
const contractsRef = useRef<HTMLSelectElement>(null)
4343
const atAddressValue = useRef<HTMLInputElement>(null)
4444
const { contractList, loadType, currentFile, compilationSource, currentContract, compilationCount, deployOptions } = props.contracts
45-
const [isVerifyChecked, setVerifyChecked] = useState<boolean>(() => {
46-
const saved = window.localStorage.getItem('deploy-verify-contract-checked')
47-
return saved !== null ? JSON.parse(saved) : true
48-
})
49-
45+
const [isVerifyChecked, setVerifyChecked] = useState<boolean>(false)
5046
const [isNetworkSupported, setNetworkSupported] = useState<boolean>(false)
5147

5248
useEffect(() => {
5349
const checkSupport = async () => {
5450
if (props.plugin) {
5551
const supportedChain = await getSupportedChain(props.plugin)
56-
setNetworkSupported(!!supportedChain)
52+
const isSupported = !!supportedChain
53+
setNetworkSupported(isSupported)
54+
55+
if (isSupported) {
56+
const saved = window.localStorage.getItem('deploy-verify-contract-checked')
57+
setVerifyChecked(saved !== null ? JSON.parse(saved) : true)
58+
} else {
59+
setVerifyChecked(false)
60+
}
5761
}
58-
}
62+
};
5963
checkSupport()
6064
}, [props.networkName])
6165

0 commit comments

Comments
 (0)