svelte-web3 icon indicating copy to clipboard operation
svelte-web3 copied to clipboard

check if user connects a address

Open softwarecurator opened this issue 3 years ago • 3 comments

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

softwarecurator avatar Feb 09 '22 20:02 softwarecurator

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.

clbrge avatar Feb 19 '22 07:02 clbrge

Keeping open so we improve the documentation to explain how to do that the right way...

clbrge avatar Mar 05 '22 10:03 clbrge

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... image

Scenario I wish to react on cancellation:

  1. User clicks connect wallet button
  2. Loading-spinner or other loading-awaiting view is shown, perhaps some animation
  3. User clicks cancel - the loading view should be hidden

yaeszlo avatar Sep 28 '22 11:09 yaeszlo