stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.08k stars 874 forks source link

fix: connect wallet button updating the screen with correct data #133

Closed HctZb closed 7 months ago

HctZb commented 1 year ago

Problem

The Connect Wallet button don't trigger Freighter to popup the login window, also the UI don't update when you login.

This fix both problems by setting a high level context with the logged account.

Solves https://github.com/stellar/soroban-example-dapp/issues/129

paulbellamy commented 1 year ago

The context seems like a nice solution, but when I connect and try to mint some of the ABND token, it says that freighter is not connected. Seems like the context and freighter are getting out-of-sync somehow.

cc @piyalbasu

HctZb commented 1 year ago

@paulbellamy thanks for the comment.

If you look here, Tyler removed this param signAndSend, that triggers freighter to sign the transaction to complete the operation. Adding this to both mint and pledge solves this. Should we add this back to the code ?

paulbellamy commented 1 year ago

Oh interesting. Nice catch, thanks!

@tyvdh Was there a reason to remove those? or mistake?

kalepail commented 1 year ago

That was likely done as these params will be changing in a future release of the CLI. Or maybe the current version the CLI has already removed these? cc @chadoh might know better as that was technically his PR