Error if transaction failed
This commit is contained in:
parent
699bf16efc
commit
c3ba5ff817
16
src/App.js
16
src/App.js
|
@ -122,9 +122,25 @@ class App extends Component {
|
||||||
sender: initialKey
|
sender: initialKey
|
||||||
}).then(async (receipt) => {
|
}).then(async (receipt) => {
|
||||||
console.log(receipt);
|
console.log(receipt);
|
||||||
|
if (receipt.status == "0x1") {
|
||||||
this.setState({loading: false})
|
this.setState({loading: false})
|
||||||
swal("Congratulations!", "Your keys are generated!", "success");
|
swal("Congratulations!", "Your keys are generated!", "success");
|
||||||
await this.generateZip({mining, voting, payout, netIdName: this.state.web3Config.netIdName});
|
await this.generateZip({mining, voting, payout, netIdName: this.state.web3Config.netIdName});
|
||||||
|
} else {
|
||||||
|
this.setState({loading: false, keysGenerated: false})
|
||||||
|
|
||||||
|
let msg = `Transaction failed`;
|
||||||
|
content.innerHTML = `<div>
|
||||||
|
Something went wrong!<br/><br/>
|
||||||
|
Please contact Master Of Ceremony<br/><br/>
|
||||||
|
${msg}
|
||||||
|
</div>`;
|
||||||
|
swal({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Error',
|
||||||
|
content: content
|
||||||
|
});
|
||||||
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
this.setState({loading: false, keysGenerated: false})
|
this.setState({loading: false, keysGenerated: false})
|
||||||
|
|
Loading…
Reference in New Issue