Wallet tab: Ad credits card counts earned credits too (promo credits looked like 0)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-13 07:29:24 -05:00
parent 53f87f79ba
commit b5eb03456c
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -197,6 +197,8 @@
// numbers only move when a campaign is created, topped up or paused
const purchased = d.credits || 0, earned = d.earnedCredits != null ? d.earnedCredits : (st.earnedAvailable != null ? st.earnedAvailable : (st.earned || 0)), inC = d.inCampaigns || 0;
$('dbCredits').textContent = (purchased + earned).toLocaleString();
// the Wallet tab card showed on-chain credits only, so promo/earned credits looked like 0 there (Jim, 2026-09-13)
if ($('creditLine')) $('creditLine').innerHTML = (purchased + earned).toLocaleString() + ' <span class="muted small" style="font-family:inherit;font-size:13px">' + purchased.toLocaleString() + ' purchased · ' + earned.toLocaleString() + ' earned</span>';
$('dbCreditsSub').textContent = purchased.toLocaleString() + ' purchased' + (d.creditedCredits ? ' (' + d.creditedCredits.toLocaleString() + ' credited to you)' : '') + ' · ' + earned.toLocaleString() + ' earned' + (inC ? ' · ' + inC.toLocaleString() + ' in campaigns' : '');
donut($('chDonut'),
[{ v: purchased, color: CH.mint }, { v: earned, color: CH.cyan }, { v: inC, color: CH.amber }],