Modify autoCompile check and url param value

pull/1510/head
ioedeveloper 3 years ago
parent 2e42ac11e7
commit af63ecb2d8
  1. 2
      apps/remix-ide-e2e/src/tests/url.spec.ts
  2. 6
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  3. 2
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts

@ -71,7 +71,7 @@ module.exports = {
'Should load using URL compiler params': function (browser: NightwatchBrowser) { 'Should load using URL compiler params': function (browser: NightwatchBrowser) {
browser browser
.pause(5000) .pause(5000)
.url('http://127.0.0.1:8080/#optimize=true&runs=300&autoCompile&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js') .url('http://127.0.0.1:8080/#optimize=true&runs=300&autoCompile=true&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js')
.refresh() .refresh()
.pause(5000) .pause(5000)
.clickLaunchIcon('solidity') .clickLaunchIcon('solidity')

@ -74,9 +74,9 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
return { return {
...prevState, ...prevState,
hideWarnings: api.getConfiguration('hideWarnings') || false, hideWarnings: api.getConfiguration('hideWarnings') || false,
autoCompile: (autoCompile !== null) && (autoCompile !== undefined) ? autoCompile : api.getConfiguration('autoCompile') || false, autoCompile: typeof autoCompile === 'boolean' ? autoCompile : api.getConfiguration('autoCompile') || false,
includeNightlies: api.getConfiguration('includeNightlies') || false, includeNightlies: api.getConfiguration('includeNightlies') || false,
optimise: (optimize !== null) && (optimize !== undefined) ? optimize : api.getConfiguration('optimise') || false, optimise: typeof optimize === 'boolean' ? optimize : api.getConfiguration('optimise') || false,
runs: (runs !== null) && (runs !== 'null') && (runs !== undefined) && (runs !== 'undefined') ? runs : 200, runs: (runs !== null) && (runs !== 'null') && (runs !== undefined) && (runs !== 'undefined') ? runs : 200,
evmVersion: (evmVersion !== null) && (evmVersion !== 'null') && (evmVersion !== undefined) && (evmVersion !== 'undefined') ? evmVersion : 'default' evmVersion: (evmVersion !== null) && (evmVersion !== 'null') && (evmVersion !== undefined) && (evmVersion !== 'undefined') ? evmVersion : 'default'
} }
@ -408,7 +408,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const checked = e.target.checked const checked = e.target.checked
api.setConfiguration('autoCompile', checked) api.setConfiguration('autoCompile', checked)
state.autoCompile && compile() checked && compile()
setState(prevState => { setState(prevState => {
return { ...prevState, autoCompile: checked } return { ...prevState, autoCompile: checked }
}) })

@ -16,7 +16,7 @@ export class CompileTab extends Plugin {
public runs public runs
public evmVersion: string public evmVersion: string
public compilerImport public compilerImport
public eventz public event
constructor (public api, public contentImport) { constructor (public api, public contentImport) {
super(profile) super(profile)

Loading…
Cancel
Save