Skip to content

Commit 633291a

Browse files
authored
Merge branch 'master' into fix-import
2 parents 2a474d3 + ef53d54 commit 633291a

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

libs/remix-ui/run-tab/src/lib/actions/index.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -559,25 +559,25 @@ export const clearInstances = () => {
559559
}
560560

561561
export const loadAddress = (contract: ContractData, address: string) => {
562-
if (!contract) return dispatch(displayPopUp('No compiled contracts found.'))
563562
loadContractFromAddress(address,
564-
(cb) => {
565-
dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null))
566-
},
567-
(error, loadType, abi) => {
568-
if (error) {
569-
return dispatch(displayNotification('Alert', error, 'OK', null))
570-
}
571-
const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name)
572-
const contractData = getSelectedContract(contract.name, compiler.name)
573-
574-
if (loadType === 'abi') {
575-
return addInstance({ contractData, address, name: '<at address>' })
576-
}
577-
addInstance({ contractData, address, name: contract.name })
578-
}
579-
)
580-
}
563+
(cb) => {
564+
dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null))
565+
},
566+
(error, loadType, abi) => {
567+
if (error) {
568+
return dispatch(displayNotification('Alert', error, 'OK', null))
569+
}
570+
if (loadType === 'abi') {
571+
return addInstance({ abi, address, name: '<at address>' })
572+
} else if (loadType === 'instance') {
573+
if (!contract) return dispatch(displayPopUp('No compiled contracts found.'))
574+
const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name)
575+
const contractData = getSelectedContract(contract.name, compiler.name)
576+
return addInstance({ contractData, address, name: contract.name })
577+
}
578+
}
579+
)
580+
}
581581

582582
export const getContext = () => {
583583
return plugin.blockchain.context()

libs/remix-ui/workspace/src/lib/reducers/workspace.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,12 @@ const fileAdded = (state: BrowserState, path: string): { [x: string]: Record<str
608608
let files = state.mode === 'browser' ? state.browser.files : state.localhost.files
609609
const _path = splitPath(state, path)
610610

611-
files = _.set(files, _path, {
611+
files = _.setWith(files, _path, {
612612
path: path,
613613
name: extractNameFromKey(path),
614614
isDirectory: false,
615615
type: 'file'
616-
})
616+
}, Object)
617617
return files
618618
}
619619

@@ -638,13 +638,13 @@ const removeInputField = (state: BrowserState, path: string): { [x: string]: Rec
638638

639639
if (prevFiles) {
640640
prevFiles.child && prevFiles.child[path + '/' + 'blank'] && delete prevFiles.child[path + '/' + 'blank']
641-
files = _.set(files, _path, {
641+
files = _.setWith(files, _path, {
642642
isDirectory: true,
643643
path,
644644
name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
645645
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
646646
child: prevFiles ? prevFiles.child : {}
647-
})
647+
}, Object)
648648
}
649649

650650
return files
@@ -674,7 +674,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
674674
delete prevFiles.child[deletePath]
675675
}
676676
}
677-
files = _.set(files, _path, prevFiles)
677+
files = _.setWith(files, _path, prevFiles, Object)
678678
} else if (payload.fileTree && payload.path) {
679679
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
680680
}
@@ -703,7 +703,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
703703
delete prevFiles.child[deletePath]
704704
}
705705
}
706-
files = _.set(files, _path, prevFiles)
706+
files = _.setWith(files, _path, prevFiles, Object)
707707
} else {
708708
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
709709
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remix-project",
3-
"version": "0.21.1-dev",
3+
"version": "0.21.2-dev",
44
"license": "MIT",
55
"description": "Ethereum Remix Monorepo",
66
"keywords": [

0 commit comments

Comments
 (0)