neelansh15 / vue-connect-wallet

✨ Connect a web3 wallet instantly using the complete MetaMask Utils + UI Button
Apache License 2.0
100 stars 19 forks source link

Would you like to support disconnect feature? #3

Open vancelin opened 1 year ago

vancelin commented 1 year ago

Hello, obviously I am a fan of this package, if you can add a disconnect function, that'll be great! thanks!

neelansh15 commented 1 year ago

Hi @vancelin Thank you so much for your support ✨

Regarding a disconnect function, MetaMask doesn't support dApps disconnecting a wallet. Users need to do this from MetaMask itself.

How I usually handle disconnect is, I have a disconnect button somewhere (dropdown, v-else with Connect button, Profile page, etc.) which when clicked will just remove the address and other information stored in variables or global state. Then the ConnectWalletButton will be back to its original state showing "Connect Wallet".

However, in terms of the button UI of this package perhaps adding a disconnect red button state could be helpful? That can be as close as it gets to supporting it.

vancelin commented 1 year ago

Hey, of course yes, if you can add a disconnect red button, that will be useful!