Merge pull request #2308 from ethereum/LianaHus-patch-6

change selected corresponding to nightly check
pull/1/head
yann300 5 years ago committed by GitHub
commit 65922b2ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/app/tabs/compileTab/compilerContainer.js

@ -284,15 +284,23 @@ class CompilerContainer {
this._updateLanguageSelector()
}
_shouldBeAdded (version) {
return !version.includes('nightly') ||
(version.includes('nightly') && this._view.includeNightlies.checked)
}
_updateVersionSelector () {
// update selectedversion of previous one got filtered out
if (!this._shouldBeAdded(this.data.selectedVersion)) {
this.data.selectedVersion = this.data.defaultVersion
}
this._view.versionSelector.innerHTML = ''
this.data.allversions.forEach(build => {
const option = build.path === this.data.selectedVersion
? yo`<option value="${build.path}" selected>${build.longVersion}</option>`
: yo`<option value="${build.path}">${build.longVersion}</option>`
if (!option.innerText.includes('nightly') ||
(option.innerText.includes('nightly') && this._view.includeNightlies.checked)) {
if (this._shouldBeAdded(option.innerText)) {
this._view.versionSelector.appendChild(option)
}
})

Loading…
Cancel
Save