HomePhabricator

[Cashtab] Patch token qty rendering error on NFT collection genesis

Description

[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:

image.png (874×1 px, 652 KB)

  • 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

Details

Provenance
bytesofmanAuthored on Jul 15 2024, 18:07
bytesofmanPushed on Jul 16 2024, 11:30
Reviewer
Restricted Project
Differential Revision
D16468: [Cashtab] Patch token qty rendering error on NFT collection genesis
Parents
rABCca55ad7ecea2: Seeder: make sure nStartingHeight is initialized
Branches
Unknown
Tags
Unknown