diff --git a/src/account.el b/src/account.el index 68dda18..909e6a1 100644 --- a/src/account.el +++ b/src/account.el @@ -718,6 +718,7 @@ fn account_page(supabase_url: String, supabase_anon_key: String) -> String {

Loading...

+
@@ -1029,7 +1030,7 @@ fn account_page(supabase_url: String, supabase_anon_key: String) -> String { } setHtml('plan-status-el', statusHtml); - // Billing note below status + // Billing note (replaces, never appends - this function may run more than once on auth state changes) var billingNote = ''; if (plan === 'founding') { billingNote = '

Lifetime · Never billed again

'; @@ -1038,8 +1039,7 @@ fn account_page(supabase_url: String, supabase_anon_key: String) -> String { } else { billingNote = '

On the waitlist

'; } - var statusEl = document.getElementById('plan-status-el'); - if (statusEl) statusEl.insertAdjacentHTML('afterend', billingNote); + setHtml('plan-billing-note-el', billingNote); // Meta var meta = ''; @@ -1055,31 +1055,16 @@ fn account_page(supabase_url: String, supabase_anon_key: String) -> String { setHtml('plan-meta-el', meta); } - // Founding badge - if (plan === 'founding' && memberNum) { + // Founding badge - always show for founding members, with member number if assigned + if (plan === 'founding') { var badgeSection = document.getElementById('badge-section'); var badgeContainer = document.getElementById('badge-html-container'); - if (badgeSection && badgeContainer) { - badgeSection.style.display = ''; - // Fetch badge HTML from server - fetch('/api/founding-badge?n=' + memberNum) - .then(function(r) { return r.text(); }) - .then(function(html) { - badgeContainer.innerHTML = html; - }) - .catch(function(e) { - console.error('Failed to load badge:', e); - }); - } - } else if (plan === 'founding') { - // Founding member but number not yet assigned - var badgeSection = document.getElementById('badge-section'); if (badgeSection) badgeSection.style.display = ''; - fetch('/api/founding-badge?n=0') + var badgeN = memberNum || 0; + fetch('/api/founding-badge?n=' + badgeN) .then(function(r) { return r.text(); }) .then(function(html) { - var c = document.getElementById('badge-html-container'); - if (c) c.innerHTML = html; + if (badgeContainer) badgeContainer.innerHTML = html; }) .catch(function() {}); }