Fix: IDENT declared before updateAll() — TDZ crash broke init (ROI storage key reads it on first paint)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-01 11:21:15 -05:00
committed by root
parent f226181ac8
commit 22b7e38e44
+12 -10
View File
@@ -2333,6 +2333,18 @@ document.querySelectorAll('.tab-btn').forEach(btn => {
if (boost && /^\d{1,6}$/.test(boost)) document.getElementById('boostFunds').value = boost;
})();
// ─── CTB Identity (sponsor alignment) ───────────────────────
// One member, two usernames: their Crypto Team Build username and their
// ClickBaitPays username (the affiliateid on their CTB downline-builder
// entry for program #73). member-program-link.php resolves either direction.
// Share links may carry ?ctb=<ctb-username> (canonical) or the legacy
// ?ref=<cbp-username>; both end up fully resolved here.
// MUST be declared before updateAll(): the ROI storage key reads IDENT
// during the first paint (TDZ crash caught live 2026-08-01).
const CTB_LOOKUP_URL = 'https://cryptoteambuild.com/api/member-program-link.php';
const HUB_BASE = 'https://ctbrewards.saasy.top';
const IDENT = { cbp: getRefFromURL() || 'cryptoteambuild', ctb: '', fallback: false };
updateAll();
// ─── URL Param Helpers ──────────────────────────────────────
@@ -2341,16 +2353,6 @@ function getRefFromURL() {
return p.get('ref') || '';
}
// ─── CTB Identity (sponsor alignment) ───────────────────────
// One member, two usernames: their Crypto Team Build username and their
// ClickBaitPays username (the affiliateid on their CTB downline-builder
// entry for program #73). member-program-link.php resolves either direction.
// Share links may carry ?ctb=<ctb-username> (canonical) or the legacy
// ?ref=<cbp-username>; both end up fully resolved here.
const CTB_LOOKUP_URL = 'https://cryptoteambuild.com/api/member-program-link.php';
const HUB_BASE = 'https://ctbrewards.saasy.top';
const IDENT = { cbp: getRefFromURL() || 'cryptoteambuild', ctb: '', fallback: false };
function getCbpUser() { return IDENT.cbp; }
function hubUrl() {