Wallet disconnects when refreshing page
Closed this issue · 6 comments
connected wallet disconnects when user refreshes the page.
hi. this is by design. you should be able to check which wallets are enabled and call a connect on the component using javascript. if not then we are missing functionality that i thought we had. we aren't currently storing the last connected wallet or automatically connecting to wallets as there could be more than 1 wallet enabled. if you'd like to add any of these features, feel free to make a pull request and i'll review it
I think "this is by design" is perfectly valid and appropriate.
Wouldn't you want a refresh to disconnect? i.e. - I think a user refreshing the page should disconnect the connected wallet, and if that's not what the DApp implementing this lib wants, then that should be it's concern?
I could be thinking about it incorrectly, but in terms of separation of concerns shouldn't it be a user of this lib that is the one deciding to persist or not persist what wallet was connected and whether or not to reconnect after a refresh?
i could see use cases where reconnect on page load/refresh would be more appropriate, but it wasn't the original use case the component was designed for. all participation and PRs welcome
i could see use cases where reconnect on page load/refresh would be more appropriate, but it wasn't the original use case the component was designed for. all participation and PRs welcome
Thanks - I am about to try it out in a core hosted blazor web assembly project to simply simulate using it as the baiss for connecting a wallet to any DApp - any pointers, demos, or gotchas you can share? :)
eh, the main challenge i guess is that if there is more than 1 wallet extension enabled you'd have to retain state between refreshes to know which one was last connected to, so you'd have to either do that outside the component or add something like blazored local storage to the component, but all still fairly straightforward
nice work RD, this feature is now added and available from v1.3.0 on nuget