HomePhabricator

[Cashtab] [wallet mgmt improvements p5] activateWallet takes currently active…

Description

[Cashtab] [wallet mgmt improvements p5] activateWallet takes currently active wallet as a param

Summary:
T2822

Depends on D12844

The activateWallet function in useWallet.js currently determines the active wallet by getting it from local storage within the function. However, due to the async nature of state variables and local storage, this value should be a parameter. That way it will match the corresponding value of walletToActivate at the time the function was called.

Test Plan:
npm start
Change the active wallet
Confirm updateSavedWalletsOnLoad called with the right params in the dev console
Change back to your previous wallet
Confirm same thing in dev console

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D12846

Details

Provenance
bytesofmanAuthored on Dec 10 2022, 18:33
bytesofmanPushed on Dec 11 2022, 05:51
Reviewer
Restricted Project
Differential Revision
D12846: [Cashtab] [wallet mgmt improvements p5] activateWallet takes currently active wallet as a param
Parents
rABC4d656c7c8ddc: [Cashtab] [wallet mgmt improvements p4] Add UI locking to useWallet.js…
Branches
Unknown
Tags
Unknown