I would like to reload the React Web3 wallet's page upon MetaMask Confirmation. Meaning when the ERC-20 token send transaction is confirmed, the page should reload or state should update to display the new balance.
In this transfer function, the pseudo-code starts with ".on()":
function refreshPage() {
window.location.reload(false);
}
transfer(recipient, amount) {
this.state.waviiiToken.methods.transfer(recipient, amount).send({ from: this.state.account })
.on('confirmation' refreshPage);
}
Please let me know if this is possible or if you have an example I can reference that updates state or refreshes the page.