shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
157 stars 180 forks source link

fix: state corruption of import accounts drawer #6817

Closed woodenfurniture closed 1 week ago

woodenfurniture commented 2 weeks ago

Description

Addresses several state corruption issues related to import accounts drawer in account management, namely state being rendered for the previously opened chain.

Key changes:

  1. Migrates the account import queries to useInfiniteQuery in order to simplify state management
  2. Resets component state when a different chain is being managed
  3. Uses an actually unique key for account rows (instead of account number which is shared across different chains)

Pull Request Type

Issue (if applicable)

NA

Risk

High Risk PRs Require 2 approvals

Low risk.

What protocols, transaction types or contract interactions might be affected by this PR?

Testing

Check that navigating to different chains in the "import accounts" drawer renders the correct toggled state of the accounts.

Engineering

Operations

Screenshots (if applicable)

Demo showing corrected state where toggles are actually representative of chain being managed:

https://github.com/shapeshift/web/assets/125113430/e20f0b9c-cc6b-4dc7-ba23-5d147af39c9e