WalletConnect & web3js - how to forget previously set wallet?

1.9k views Asked by At

I'm writig a dApp using web3Modal and web3js libraries. I have an issue regarding the WalletConnect provider.

Upon choosing to connect using WalletConnect, the QR code doesn't show up and I'm immeidatly connected to the previous (old local test network..) wallet.

I tried looking for an option in the WalletConnectProvider api and the web3js libraries, without success.

Openning the website in incognitio mode DOES work, but loading the page without using cache does not work (ctrl+shift+f5 on chrome), nor does disabling cache using html headers.

I'm not sure what am I missing, as it's clearly saved somewhere but not in the cache.

2

There are 2 answers

0
Yur D On BEST ANSWER

First you need to use connector.killSession() and then clear local storage.

0
blades On

Solution: clear local storage using localStorage.clear(). More granulaity should be possible if need be.