HomePhabricator

[Cashtab] Update loadCashtabState to not take params

Description

[Cashtab] Update loadCashtabState to not take params

Summary:
Quickly ran into problems with param based approach here when tried to work on a second one.

setState is an async function. But, in react, there is not a practical way to await this. You can reliably trigger actions to happen when state changes, e.g. a callback or useEffect. However this would make for a long daisy chain of loading functions to get everything we need into cashtabState.

Because we always want to load all of the localforage stuff at the same time on startup, we do not need to use a key...value approach and various customizations depending on the key. Instead, go through and load/validate/migrate everything.

Note: for now, we still have only implemented contactList in the new cashtabState general object.

Test Plan: npm test

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
bytesofmanAuthored on Feb 20 2024, 21:01
bytesofmanPushed on Feb 24 2024, 23:56
Reviewer
Restricted Project
Differential Revision
D15499: [Cashtab] Update loadCashtabState to not take params
Parents
rABCe35766dba520: [Cashtab] Support for explicit slpv1 burn txs
Branches
Unknown
Tags
Unknown