From 5943059f22d07936d236f34bc8728f9b03a935f3 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 26 Feb 2020 07:50:52 +0000 Subject: [PATCH] Reinitialize Checkbox state after switching to new contract --- src/app/tabs/runTab/contractDropdown.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/runTab/contractDropdown.js b/src/app/tabs/runTab/contractDropdown.js index e34585f14d..ad19f9b5c0 100644 --- a/src/app/tabs/runTab/contractDropdown.js +++ b/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`` var info = yo`` @@ -56,8 +61,7 @@ class ContractDropdownUI { this.createPanel = yo`
` this.orLabel = yo`
or
` - const ipfsCheckbox = this.ipfsCheckedState ? yo`` - : yo` { + const ipfsCheckbox = yo` { if (!this.ipfsCheckedState) { publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.apply(this)) this.ipfsCheckedState = true