Stack POL Pro owned state (Marty 2026-11-10): a Pro owner sees '⭐ You own Stack POL Pro', the unlock date and an 'Open my Pro page' button instead of a one-line note; the Stack POL pane re-checks when the member returns to the tab, so a purchase made while it was open shows without a manual refresh. my.js ?v=20261110proown. Member walk 0 bugs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-10 07:37:28 -06:00
parent f20e845cf1
commit 2e4d18d77d
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -2801,8 +2801,13 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('spOn').checked = !!d.on; $('spLinkRow').hidden = !d.on; $('spUrl').textContent = d.url || ''; $('spOpen').href = d.url || '#';
$('spNote').textContent = d.on ? (d.wallet ? 'Your page is live once a payout reaches your wallet and updates every 5 minutes.' : 'Link a wallet (Wallet tab) so your payouts can be added up on your page.') : '';
const pv = d.pro || {}; $('spProOn').hidden = !pv.pro; $('spProOff').hidden = !!pv.pro; // any $10+ package unlocks Pro (2026-11-09): no order to wait on
// owned state (Marty 2026-11-10): say plainly that the member OWNS the upgrade, since when, with a link to the Pro page
$('spProSince').textContent = pv.pro && pv.since ? 'Unlocked ' + new Date(pv.since).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) + '. ' : '';
$('spProOpen').href = d.url || '#';
}
async function stackPolPost(body) { const r = await fetch('/api/my/stackpol', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); const d = await r.json(); if (!r.ok) throw new Error(d.error || 'Could not save that.'); return d; }
// a purchase made in another tab or on chain while this pane was open (Marty 2026-11-10): re-check when the member comes back
document.addEventListener('visibilitychange', () => { const el = $('promo-stackpol'); if (!document.hidden && el && !el.hidden) loadStackPol(); });
async function loadStackPol() { try { const r = await fetch('/api/my/stackpol'); const d = await r.json(); if (!r.ok) { $('spNote').textContent = d.error || ''; return; } showStackPol(d); } catch (e) {} }
if ($('spOn')) {
$('spOn').addEventListener('change', async () => {