Skip to content

Commit

Permalink
Popups on fail and success
Browse files Browse the repository at this point in the history
  • Loading branch information
Swader committed Dec 29, 2020
1 parent 5380ae7 commit d7eaf6e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,21 @@ async function pay(amount, account, chain) {
// Create TX
api.tx.balances
.transfer(config[chain].recipient, parseInput(amount, e))
.signAndSend(SENDER, { signer: injector.signer }, (status) => { console.log(status) });
.signAndSend(SENDER, { signer: injector.signer }, (status) => {
Swal.fire({
title: 'Thank you!',
text: "Transaction sent!",
icon: 'success',
confirmButtonText: "Yay!"
})
}).catch( function(error) {
Swal.fire({
title: 'Error',
text: "Canceled transaction. Need help? Contact [email protected]!",
icon: 'error',
confirmButtonText: "OK"
})
});
}

const BN_TEN = new BN(10);
Expand Down

0 comments on commit d7eaf6e

Please sign in to comment.