secretkeylabs / xverse-web-extension

Other
40 stars 19 forks source link

[ENG-3193] refactor: Refactor away from selectedOrdinal #791

Closed terencehh closed 4 months ago

terencehh commented 5 months ago

🔘 PR Type

What kind of change does this PR introduce?

📜 Background

There is a state bug where selectedOrdinal has improper state when on multiple tabs (it overwriting the current selectedOrdinal on the page). This PR introduces a fix by removing state management for selectedOrdinal, and instead always opting to look up the ordinal using the ordinalId in URL params, and finding the selected ordinal via react-query hooks (with caching)

Issue Link: ENG-3193 Context Link (if applicable):

🔄 Changes

Impact:

🖼 Screenshot / 📹 Video

Send/Confirm Ordinals Screen Bug video

https://github.com/secretkeylabs/xverse-web-extension/assets/30040178/4699cbe7-4718-4a61-84b0-cdaa313a1412

Send/Confirm Ordinals Screen Fix video

https://github.com/secretkeylabs/xverse-web-extension/assets/30040178/ca6f21dc-aecf-4a55-943a-679429a84938

Recover Funds/Ordinals Screen Bug video

https://github.com/secretkeylabs/xverse-web-extension/assets/30040178/d010e5d2-b53c-43b3-a35a-4594a583e6c9

Recover Funds/Ordinals Screen Fix video

https://github.com/secretkeylabs/xverse-web-extension/assets/30040178/96f1a5ec-4db0-48b2-9b91-77d452f00f4e

✅ Review checklist

Please ensure the following are true before merging:

teebszet commented 5 months ago

nice! so much cleaner. love it when we can remove code like this

image

DuskaT021 commented 4 months ago

@terencehh there is a small conflict that needs to be resolved

github-actions[bot] commented 4 months ago

Test with build here: https://github.com/secretkeylabs/xverse-web-extension/actions/runs/8018139200

DuskaT021 commented 4 months ago

@terencehh tested, noice, lgtm 👏