diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index 49c0bbedbc..95ef6f8a76 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -559,25 +559,25 @@ export const clearInstances = () => { } export const loadAddress = (contract: ContractData, address: string) => { - if (!contract) return dispatch(displayPopUp('No compiled contracts found.')) loadContractFromAddress(address, - (cb) => { - dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null)) - }, - (error, loadType, abi) => { - if (error) { - return dispatch(displayNotification('Alert', error, 'OK', null)) - } - const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name) - const contractData = getSelectedContract(contract.name, compiler.name) - - if (loadType === 'abi') { - return addInstance({ contractData, address, name: '' }) - } - addInstance({ contractData, address, name: contract.name }) - } - ) -} + (cb) => { + dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null)) + }, + (error, loadType, abi) => { + if (error) { + return dispatch(displayNotification('Alert', error, 'OK', null)) + } + if (loadType === 'abi') { + return addInstance({ abi, address, name: '' }) + } else if (loadType === 'instance') { + if (!contract) return dispatch(displayPopUp('No compiled contracts found.')) + const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name) + const contractData = getSelectedContract(contract.name, compiler.name) + return addInstance({ contractData, address, name: contract.name }) + } + } + ) + } export const getContext = () => { return plugin.blockchain.context() diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index a41365224b..cf3e3a1cbf 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -608,12 +608,12 @@ const fileAdded = (state: BrowserState, path: string): { [x: string]: Record