WalletConnectV2 unable to re-connect
Unable to reconnect using WalletConnectV2, for V1 I removed the localStorage variable before connecting but V2 introduce a lot of new variables and removing them doesn't work.
This can be reproduced with the hosted example:
- Connect with WalletConnectV2
- Disconnect
- Try to connect again -> nothing happens
Hi @lcamargof, I tested with our react-app example here and our Web3Modal demo and cannot reproduce the issue you are seeing with the steps provided.
Could you please share additional steps (ideally a complete reproducible example) so that I can reproduce the issue on my end? 🙏
Hi @chris13524 I'll take a look at the code for the official repo example, but I reproduced the issue with the web3-react demo, you can reproduce it with this code
Edit:
As a workaround, after connector.deactivate() I needed to add a 1000ms timeout to call activate() and the wallet modal shows up.
I am able to reproduce it as well in my dApp.
I found that this is caused by using IndexDB. As a fix, I use clearing WALLET_CONNECT_V2_INDEXED_DB in the browser, but it requires a page reload to take effect. Looks glitchy. Has anyone found a proper way to avoid this?
Edit: As a workaround, after
connector.deactivate()I needed to add a 1000ms timeout to callactivate()and the wallet modal shows up.
It doesn't look like stable solution
Hi @lcamargof, I tested with our react-app example here and our Web3Modal demo and cannot reproduce the issue you are seeing with the steps provided.
Could you please share additional steps (ideally a complete reproducible example) so that I can reproduce the issue on my end? 🙏
I'm guessing that you couldn't reproduce the bug because your application redirects the user to another page. Everything seems to be working fine in this case. But my application can display a 401/403 response error and keep the user on the login page.