Move publish to ipfs to final callback

pull/1/head
ioedeveloper 5 years ago
parent cb74534e0a
commit 4a341b2521
  1. 8
      src/app/tabs/runTab/contractDropdown.js
  2. 3
      src/publishToStorage.js

@ -174,10 +174,7 @@ class ContractDropdownUI {
const selectedContract = this.getSelectedContract() const selectedContract = this.getSelectedContract()
const clickCallback = async (valArray, inputsValues) => { const clickCallback = async (valArray, inputsValues) => {
var selectedContract = this.getSelectedContract() var selectedContract = this.getSelectedContract()
await this.createInstance(selectedContract, inputsValues) this.createInstance(selectedContract, inputsValues)
if (this.ipfsCheckedState) {
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, selectedContract)
}
} }
const createConstructorInstance = new MultiParamManager( const createConstructorInstance = new MultiParamManager(
0, 0,
@ -241,6 +238,9 @@ class ContractDropdownUI {
} }
this.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name]) this.event.trigger('newContractInstanceAdded', [contractObject, address, contractObject.name])
if (this.ipfsCheckedState) {
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, selectedContract)
}
} }
let contractMetadata let contractMetadata

@ -14,8 +14,7 @@ export default function publish (storage, fileProvider, fileManager, contract) {
try { try {
err = JSON.stringify(err) err = JSON.stringify(err)
} catch (e) {} } catch (e) {}
modalDialogCustom.alert(yo`<span>Failed to publish metadata file to swarm, please check the Swarm gateways is available ( swarm-gateways.net ).<br /> console.log(`Failed to publish metadata file to swarm, please check the Swarm gateways is available ( swarm-gateways.net ) ${err}`)
${err}</span>`)
} else { } else {
var result = yo`<div>${uploaded.map((value) => { var result = yo`<div>${uploaded.map((value) => {
return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>` return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>`

Loading…
Cancel
Save