DEV Community

Discussion on: Web3 Tutorial: build DApp with Hardhat, React and Ethers.js

Collapse
 
danielesposito profile image
Daniel Esposito

Great tutorial! Just one quick question. How can I persist my connection to Metamask so I don't have to connect to wallet every time I refresh the page and instead simply show the address and balance if there's a connection already established? Thank you in advance

Collapse
 
yakult profile image
fangjun

If you run connect in ethers.js, you will find that you are still connected.

The connection only can be canceled by user in metamask. So the connection is still there.