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 }],
+2 -2
View File
@@ -867,7 +867,7 @@
<p id="walletBal" class="small" hidden></p></div>
<div class="card"><h3>Ad credits</h3>
<p class="mono" style="font-size:26px;margin:0" id="creditLine">0</p>
<p class="muted small">1 credit = 1 cent of ad delivery across the network. Recorded on-chain. Only your campaigns can spend them.</p></div>
<p class="muted small">1 credit = 1 cent of ad delivery across the network. Purchased credits are recorded on-chain; earned credits (viewing, promo codes, welcome bonus) live on your account. Only your campaigns can spend them.</p></div>
</div>
<div class="card" id="linkCard" hidden>
<h3>Link your wallet</h3>
@@ -915,7 +915,7 @@
<script src="/assets/common.js?v=20260913a"></script>
<script src="/assets/wallet.js?v=20260911a"></script>
<script src="/assets/promo.js?v=20260911a"></script>
<script src="/assets/my.js?v=20260913b"></script>
<script src="/assets/my.js?v=20260913c"></script>
<script src="/assets/chat.js?v=20260907l"></script>
</body>
</html>