|
|
@ -48,14 +48,13 @@ 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 = name |
|
|
|
this.networkName = network.name |
|
|
|
|
|
|
|
|
|
|
|
const savedConfig = window.localStorage.getItem(`ipfs/${this.exEnvironment}/${this.networkName}`) |
|
|
|
const savedConfig = window.localStorage.getItem(`ipfs/${this.exEnvironment}/${this.networkName}`) |
|
|
|
|
|
|
|
|
|
|
@ -66,7 +65,6 @@ class ContractDropdownUI { |
|
|
|
this.setCheckedState(this.networkName === 'Main') |
|
|
|
this.setCheckedState(this.networkName === 'Main') |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setCheckedState (value) { |
|
|
|
setCheckedState (value) { |
|
|
@ -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]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|