fix: use null instead of 0 for testnet token USD fallback
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:
user
2026-03-01 11:18:04 -08:00
parent 57de01b546
commit 8c805537c0

View File

@@ -161,7 +161,7 @@ function show() {
`<a href="${addrLink}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`; `<a href="${addrLink}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
// USD total for this token only // USD total for this token only
const usdVal = price ? amount * price : 0; const usdVal = price ? amount * price : null;
const usdStr = formatUsd(usdVal); const usdStr = formatUsd(usdVal);
$("address-token-usd-total").innerHTML = usdStr || "&nbsp;"; $("address-token-usd-total").innerHTML = usdStr || "&nbsp;";