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:
@@ -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 || " ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user