Commit 4a55a126 authored by ioedeveloper's avatar ioedeveloper

Fix linting error

parent 3ddce10c
...@@ -56,12 +56,10 @@ class ContractDropdownUI { ...@@ -56,12 +56,10 @@ class ContractDropdownUI {
this.createPanel = yo`<div class="${css.deployDropdown}"></div>` this.createPanel = yo`<div class="${css.deployDropdown}"></div>`
this.orLabel = yo`<div class="${css.orLabel}">or</div>` this.orLabel = yo`<div class="${css.orLabel}">or</div>`
const ipfsCheckbox = this.ipfsCheckedState ? const ipfsCheckbox = this.ipfsCheckedState ? yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" />`
yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" />` : yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => {
: if (!this.ipfsCheckedState) {
yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => { publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.apply(this))
if(!this.ipfsCheckedState){
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.call(this))
this.ipfsCheckedState = true this.ipfsCheckedState = true
} }
}}>` }}>`
......
...@@ -4,28 +4,28 @@ const publishOnIpfs = require('./lib/publishOnIpfs') ...@@ -4,28 +4,28 @@ const publishOnIpfs = require('./lib/publishOnIpfs')
const modalDialogCustom = require('./app/ui/modal-dialog-custom') const modalDialogCustom = require('./app/ui/modal-dialog-custom')
export default function publish (storage, fileProvider, fileManager, contract) { export default function publish (storage, fileProvider, fileManager, contract) {
if (contract) { if (contract) {
if (contract.metadata === undefined || contract.metadata.length === 0) { if (contract.metadata === undefined || contract.metadata.length === 0) {
modalDialogCustom.alert('This contract may be abstract, may not implement an abstract parent\'s methods completely or not invoke an inherited contract\'s constructor correctly.') modalDialogCustom.alert('This contract may be abstract, may not implement an abstract parent\'s methods completely or not invoke an inherited contract\'s constructor correctly.')
} else {
if (storage === 'swarm') {
publishOnSwarm(contract, fileManager, function (err, uploaded) {
if (err) {
try {
err = JSON.stringify(err)
} catch (e) {}
modalDialogCustom.alert(yo`<span>Failed to publish metadata file to swarm, please check the Swarm gateways is available ( swarm-gateways.net ).<br />
${err}</span>`)
} else {
var result = yo`<div>${uploaded.map((value) => {
return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>`
})}</div>`
modalDialogCustom.alert(yo`<span>Metadata published successfully.<br> <pre>${result}</pre> </span>`)
}
}, (item) => { // triggered each time there's a new verified publish (means hash correspond)
fileProvider.addExternal('swarm/' + item.hash, item.content)
})
} else { } else {
if (storage === 'swarm') {
publishOnSwarm(contract, fileManager, function (err, uploaded) {
if (err) {
try {
err = JSON.stringify(err)
} catch (e) {}
modalDialogCustom.alert(yo`<span>Failed to publish metadata file to swarm, please check the Swarm gateways is available ( swarm-gateways.net ).<br />
${err}</span>`)
} else {
var result = yo`<div>${uploaded.map((value) => {
return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>`
})}</div>`
modalDialogCustom.alert(`Published ${contract.name}'s Metadata`, yo`<span>Metadata of "${contract.name.toLowerCase()}" was published successfully.<br> <pre>${result}</pre> </span>`)
}
}, (item) => { // triggered each time there's a new verified publish (means hash correspond)
fileProvider.addExternal('swarm/' + item.hash, item.content)
})
} else {
publishOnIpfs(contract, fileManager, function (err, uploaded) { publishOnIpfs(contract, fileManager, function (err, uploaded) {
if (err) { if (err) {
try { try {
...@@ -45,4 +45,4 @@ export default function publish (storage, fileProvider, fileManager, contract) { ...@@ -45,4 +45,4 @@ export default function publish (storage, fileProvider, fileManager, contract) {
} }
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment