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

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

Loading…
Cancel
Save