|
|
@ -48,24 +48,22 @@ class ContractDropdownUI { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
listenToContextChange () { |
|
|
|
listenToContextChange () { |
|
|
|
this.blockchain.event.register('contextChanged', () => { |
|
|
|
this.blockchain.event.register('networkStatus', ({ error, network }) => { |
|
|
|
this.blockchain.updateNetwork((err, { name } = {}) => { |
|
|
|
if (error) { |
|
|
|
if (err) { |
|
|
|
console.log('can\'t detect network') |
|
|
|
console.log('can\'t detect network') |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.exEnvironment = this.blockchain.getProvider() |
|
|
|
this.exEnvironment = this.blockchain.getProvider() |
|
|
|
this.networkName = network.name |
|
|
|
this.networkName = name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const savedConfig = window.localStorage.getItem(`ipfs/${this.exEnvironment}/${this.networkName}`) |
|
|
|
const savedConfig = window.localStorage.getItem(`ipfs/${this.exEnvironment}/${this.networkName}`) |
|
|
|
|
|
|
|
|
|
|
|
// check if an already selected option exist else use default workflow
|
|
|
|
// check if an already selected option exist else use default workflow
|
|
|
|
if (savedConfig !== null) { |
|
|
|
if (savedConfig !== null) { |
|
|
|
this.setCheckedState(savedConfig) |
|
|
|
this.setCheckedState(savedConfig) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.setCheckedState(this.networkName === 'Main') |
|
|
|
this.setCheckedState(this.networkName === 'Main') |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -306,10 +304,10 @@ class ContractDropdownUI { |
|
|
|
const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) |
|
|
|
const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file) |
|
|
|
self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) |
|
|
|
self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data) |
|
|
|
if (self.ipfsCheckedState) { |
|
|
|
if (self.ipfsCheckedState) { |
|
|
|
_paq.push(['trackEvent', 'udapp', `DeployAndPublish_${this.networkName}`]) |
|
|
|
_paq.push(['trackEvent', 'udapp', 'DeployAndPublish', this.networkName]) |
|
|
|
publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) |
|
|
|
publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
_paq.push(['trackEvent', 'udapp', `DeployOnly_${this.networkName}`]) |
|
|
|
_paq.push(['trackEvent', 'udapp', 'DeployOnly', this.networkName]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|