Merge branch 'master' into fix-import

pull/2038/head
David Disu 3 years ago committed by GitHub
commit 633291a5e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      libs/remix-ui/run-tab/src/lib/actions/index.ts
  2. 12
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  3. 2
      package-lock.json
  4. 2
      package.json

@ -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: '<at address>' })
}
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: '<at address>' })
} 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()

@ -608,12 +608,12 @@ const fileAdded = (state: BrowserState, path: string): { [x: string]: Record<str
let files = state.mode === 'browser' ? state.browser.files : state.localhost.files
const _path = splitPath(state, path)
files = _.set(files, _path, {
files = _.setWith(files, _path, {
path: path,
name: extractNameFromKey(path),
isDirectory: false,
type: 'file'
})
}, Object)
return files
}
@ -638,13 +638,13 @@ const removeInputField = (state: BrowserState, path: string): { [x: string]: Rec
if (prevFiles) {
prevFiles.child && prevFiles.child[path + '/' + 'blank'] && delete prevFiles.child[path + '/' + 'blank']
files = _.set(files, _path, {
files = _.setWith(files, _path, {
isDirectory: true,
path,
name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: prevFiles ? prevFiles.child : {}
})
}, Object)
}
return files
@ -674,7 +674,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
delete prevFiles.child[deletePath]
}
}
files = _.set(files, _path, prevFiles)
files = _.setWith(files, _path, prevFiles, Object)
} else if (payload.fileTree && payload.path) {
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
}
@ -703,7 +703,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
delete prevFiles.child[deletePath]
}
}
files = _.set(files, _path, prevFiles)
files = _.setWith(files, _path, prevFiles, Object)
} else {
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
}

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "remix-project",
"version": "0.21.1-dev",
"version": "0.21.2-dev",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "remix-project",
"version": "0.21.1-dev",
"version": "0.21.2-dev",
"license": "MIT",
"description": "Ethereum Remix Monorepo",
"keywords": [

Loading…
Cancel
Save