Move publish to ipfs to final callback

pull/5370/head
ioedeveloper 5 years ago
parent bfed7d92c1
commit f257c6763c
  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