refactor to setConfiguration

pull/11/head
yann300 4 years ago committed by ioedeveloper
parent e0d4a0ba88
commit 536d8e7081
  1. 5
      apps/remix-ide/src/app/tabs/compile-tab.js
  2. 7
      apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js

@ -246,10 +246,7 @@ class CompileTab extends ViewPlugin {
setCompilerConfig (settings) {
return new Promise((resolve, reject) => {
addTooltip(yo`<div><b>${this.currentRequest.from}</b> is updating the <b>Solidity compiler configuration</b>.<pre class="text-left">${JSON.stringify(settings, null, '\t')}</pre></div>`)
this.compilerContainer.setLanguage(settings.language)
this.compilerContainer.setEvmVersion(settings.evmVersion)
this.compilerContainer.setOptimize(settings.optimize)
this.compilerContainer.setVersion(settings.version)
this.compilerContainer.setConfiguration(settings)
// @todo(#2875) should use loading compiler return value to check whether the compiler is loaded instead of "setInterval"
let timeout = 0
const id = setInterval(() => {

@ -353,6 +353,13 @@ class CompilerContainer {
They are an external API for modifying the compiler configuration.
*/
setConfiguration (settings) {
this.setLanguage(settings.language)
this.setEvmVersion(settings.evmVersion)
this.setOptimize(settings.optimize)
this.setVersion(settings.version)
}
setOptimize (enabled) {
this._view.optimize.checked = enabled
this.onchangeOptimize()

Loading…
Cancel
Save