Reinitialize Checkbox state after switching to new contract

pull/1/head
ioedeveloper 5 years ago
parent 4a55a12656
commit ff4395d4ee
  1. 10
      src/app/tabs/runTab/contractDropdown.js

@ -43,10 +43,15 @@ class ContractDropdownUI {
this.compFails.style.display = 'block'
document.querySelector(`.${css.contractNames}`).classList.add(css.contractNamesError)
}
this.ipfsCheckedState = false
this.reinitializeIpfsCheckedState()
})
}
reinitializeIpfsCheckedState () {
this.ipfsCheckedState = false
document.querySelector('#deployAndRunPublishToIPFS').checked = false
}
render () {
this.compFails = yo`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="m-1 fas fa-times-circle ${css.errorIcon}" ></i>`
var info = yo`<i class="fas fa-info ${css.infoDeployAction}" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>`
@ -56,8 +61,7 @@ class ContractDropdownUI {
this.createPanel = yo`<div class="${css.deployDropdown}"></div>`
this.orLabel = yo`<div class="${css.orLabel}">or</div>`
const ipfsCheckbox = this.ipfsCheckedState ? yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" />`
: yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => {
const ipfsCheckbox = yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => {
if (!this.ipfsCheckedState) {
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.apply(this))
this.ipfsCheckedState = true

Loading…
Cancel
Save