fix: use null instead of 0 for testnet token USD fallback
All checks were successful
check / check (push) Successful in 12s
All checks were successful
check / check (push) Successful in 12s
When price is null (testnet), the fallback value 0 caused formatUsd() to display "$0.00" instead of hiding the USD value. Using null makes formatUsd() return an empty string, so the UI correctly shows no USD on the token detail view.
This commit is contained in:
parent
57de01b546
commit
8c805537c0
@ -161,7 +161,7 @@ function show() {
|
||||
`<a href="${addrLink}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
|
||||
|
||||
// USD total for this token only
|
||||
const usdVal = price ? amount * price : 0;
|
||||
const usdVal = price ? amount * price : null;
|
||||
const usdStr = formatUsd(usdVal);
|
||||
$("address-token-usd-total").innerHTML = usdStr || " ";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user