svelte-web3
svelte-web3 copied to clipboard
check if user connects a address
something like
defaultEvmStores.setProvider().then("connected" => //do something)
or
await defaultEvmStores.setProvider() //do something here
because right now it throws no error or anything to indicate that the user didn't connect a address other than checking if $selectedAccount exists
I'm not sure this is the correct direction. The whole package is about store. In my opinion the correct pattern should be to subscribe to the selectedAccount and //do something in the subscription handler.
Keeping open so we improve the documentation to explain how to do that the right way...
This is a very weird approach since when the user rejects the connection the error is thrown, just not passed down to the caller method...
Scenario I wish to react on cancellation:
- User clicks connect wallet button
- Loading-spinner or other loading-awaiting view is shown, perhaps some animation
- User clicks cancel - the loading view should be hidden