CBP ref fallback chain: own entry -> upline sponsor's entry -> company (Marty's rule)

Endpoint walks one hop up ref_by when the member's own program-73 entry is
empty; response carries source: self|sponsor. Calculator shows an adapted
nudge on upline fallback (alignment held, but claim your own referrals).
Hub invite still aligns to the SHARER either way.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-01 11:53:44 -05:00
committed by root
parent 2e3c480358
commit 0042bca9e5
+12 -2
View File
@@ -2370,9 +2370,16 @@ function updateHubLinks() {
}
}
function showSponsorNudge() {
function showSponsorNudge(kind) {
const el = document.getElementById('sponsorNudge');
if (el) el.style.display = 'block';
if (!el) return;
if (kind === 'sponsor') {
// Endpoint resolved the CBP ref from the member's UPLINE sponsor's entry
// (fallback chain: own entry → upline's entry → company). Alignment held,
// but the sharer should still claim their own referrals.
el.innerHTML = '⚠️ This sponsor hasn’t added their own ClickBaitPays username in CryptoTeamBuild yet, so sign-ups credit their upline sponsor for now. <strong>Sponsors:</strong> log into CryptoTeamBuild → Downline Builder → ClickBaitPays → enter your ClickBaitPays username, and your links switch to you automatically.';
}
el.style.display = 'block';
}
async function resolveIdentity() {
@@ -2387,6 +2394,7 @@ async function resolveIdentity() {
if (r.found) {
IDENT.cbp = r.cbpUsername;
IDENT.ctb = r.ctbUsername;
if (r.source === 'sponsor') IDENT.uplineFallback = true;
} else {
const rv = await fetch(`${CTB_LOOKUP_URL}?cbp=${encodeURIComponent(ctbParam)}`).then(x => x.json());
if (rv.found) {
@@ -2413,6 +2421,7 @@ async function resolveIdentity() {
if (f.found) {
IDENT.cbp = f.cbpUsername;
IDENT.ctb = f.ctbUsername;
if (f.source === 'sponsor') IDENT.uplineFallback = true;
}
}
}
@@ -2423,6 +2432,7 @@ async function resolveIdentity() {
updateSharedLinkBox();
updateHubLinks();
if (IDENT.fallback) showSponsorNudge();
else if (IDENT.uplineFallback) showSponsorNudge('sponsor');
}
function getBaseUrl() {