stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.1k stars 889 forks source link

example-dapp: Show the new contract data after the txn submission #4

Closed paulbellamy closed 1 year ago

paulbellamy commented 2 years ago

Once you submit the txn we should update the page with the new state.

Update:

paulbellamy commented 2 years ago

The easiest solution here is probably just to trigger a re-fetch when useSendTransaction's callback is successful.

esteblock commented 1 year ago

This was solved in https://github.com/stellar/soroban-example-dapp/commit/82adf511ec76a0dc14f35a019ff135bc74801303

At the end of the transaction, by calling sorobanContext.connect(), it update the context, and hence, updates all the values that depend on that context.

See: https://github.com/stellar/soroban-example-dapp/blob/9697fcab04f2ba399333ad33d3699f99cd4df452/components/molecules/form-pledge/index.tsx#L323

esteblock commented 1 year ago

Should be marked as Soved @paulbellamy