fix: an address holding only unpriced tokens is no longer totalled at $0.00 (closes #261)
Some checks failed
check / check (push) Has been cancelled

This commit was merged in pull request #298.
This commit is contained in:
2026-08-17 08:38:10 +02:00
parent d9d50f05d2
commit e07efb710a
10 changed files with 370 additions and 64 deletions

View File

@@ -28,8 +28,9 @@ const {
} = require("../../shared/walletDefects");
const {
formatUsd,
formatAddressTotal,
getPrice,
getAddressValueUsd,
getAddressValue,
} = require("../../shared/prices");
const {
fetchRecentTransactions,
@@ -71,9 +72,7 @@ function renderTotalValue() {
el.textContent = ethStr + ethUsd;
if (subEl) {
const totalUsd = getAddressValueUsd(addr);
subEl.innerHTML =
totalUsd !== null ? "Total: " + formatUsd(totalUsd) : " ";
subEl.innerHTML = formatAddressTotal(getAddressValue(addr)) || " ";
}
}
@@ -257,8 +256,8 @@ function walletListHtml() {
html += `<span class="flex items-center break-all">${addr.ensName ? "" : dot}${addr.address}</span>`;
html += `<span class="flex-shrink-0 ml-1">${infoBtn}${removeBtn}</span>`;
html += `</div>`;
const addrUsd = formatUsd(getAddressValueUsd(addr));
html += `<div class="text-xs text-muted text-right min-h-[1rem]">${addrUsd || "&nbsp;"}</div>`;
const addrTotal = formatAddressTotal(getAddressValue(addr));
html += `<div class="text-xs text-muted text-right min-h-[1rem]">${addrTotal || "&nbsp;"}</div>`;
html += balanceLinesForAddress(
addr,
state.trackedTokens,