[Cashtab] Patch token qty rendering error on NFT collection genesis
Summary:
Diff to resolve reported bug where user, after creating an NFT collection, may encounter an app-crashing error.
Looking into what happened here:
- User creates a new NFT collection
- Cashtab auto-routes the user to the Token page for this collection, so the user can start minting or other token action
- App crashes
From the error msg, crash is coming bc an input param passed to decimalizedTokenQtyToLocaleFormat is undefined
This makes sense bc this param comes from a cache request or an API call, and is not (necessarily) expected to be available, tho I have not come across this issue before. This is an existing issue that is not related to the NFT diff.
Updated to show a loader for values that are not yet available, preventing the function call unless we have the right kind of param. Added a test for the locale and qty of the report to confirm that this was not the issue.
Test Plan: npm test
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16468