added checks before compilation

pull/1/head
LianaHus 6 years ago
parent 1afc556839
commit c5e658920a
  1. 20
      src/app/tabs/compileTab/compilerContainer.js

@ -137,7 +137,7 @@ class CompilerContainer {
this._view.versionSelector = yo` this._view.versionSelector = yo`
<select onchange="${this.onchangeLoadVersion.bind(this)}" class="custom-select" id="versionSelector" disabled> <select onchange="${this.onchangeLoadVersion.bind(this)}" class="custom-select" id="versionSelector" disabled>
<option disabled selected>Select new compiler version</option> <option disabled selected>${this.data.defaultVersion}</option>
</select>` </select>`
this._view.languageSelector = yo` this._view.languageSelector = yo`
<select onchange="${this.onchangeLanguage.bind(this)}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7"> <select onchange="${this.onchangeLanguage.bind(this)}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7">
@ -234,22 +234,30 @@ class CompilerContainer {
} }
compile (event) { compile (event) {
if (this.config.get('currentFile')) {
this.compileTabLogic.runCompiler() this.compileTabLogic.runCompiler()
} }
}
autoCompile () {
if (this.config.get('autoCompile')) {
this.compile()
}
}
hideWarnings (event) { hideWarnings (event) {
this.config.set('hideWarnings', this._view.hideWarningsBox.checked) this.config.set('hideWarnings', this._view.hideWarningsBox.checked)
this.compile() this.autoCompile()
} }
onchangeOptimize () { onchangeOptimize () {
this.compileTabLogic.setOptimize(!!this._view.optimize.checked) this.compileTabLogic.setOptimize(!!this._view.optimize.checked)
this.compileTabLogic.runCompiler() this.autoCompile()
} }
onchangeLanguage (event) { onchangeLanguage (event) {
this.compileTabLogic.setLanguage(event.target.value) this.compileTabLogic.setLanguage(event.target.value)
this.compile() this.autoCompile()
} }
onchangeEvmVersion (_) { onchangeEvmVersion (_) {
@ -259,7 +267,7 @@ class CompilerContainer {
v = null v = null
} }
this.compileTabLogic.setEvmVersion(v) this.compileTabLogic.setEvmVersion(v)
this.compile() this.autoCompile()
} }
onchangeLoadVersion (event) { onchangeLoadVersion (event) {
@ -343,7 +351,7 @@ class CompilerContainer {
scheduleCompilation () { scheduleCompilation () {
if (!this.config.get('autoCompile')) return if (!this.config.get('autoCompile')) return
if (this.data.compileTimeout) window.clearTimeout(this.data.compileTimeout) if (this.data.compileTimeout) window.clearTimeout(this.data.compileTimeout)
this.data.compileTimeout = window.setTimeout(() => this.compileTabLogic.runCompiler(), this.data.timeout) this.data.compileTimeout = window.setTimeout(() => this.autoCompile(), this.data.timeout)
} }
} }

Loading…
Cancel
Save