Wire the join funnel to the live /join-now self-enroll page
/join-now now honors ?ref=<id> (resolves that member's moving-link joinTarget; falls back to the global rotation sponsor). Repointed: /start 'Join With Current Sponsor' -> /join-now; /my pitch buttons -> /join-now?ref=<id>; invite page /join/<id> join button -> /join-now?ref=<id>; bare /join redirect -> /join-now. 'Get Started' learn CTAs still go to /start for onboarding. When the flag is off, /join-now gracefully redirects to /start, so the wiring is safe either way. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-2
@@ -44,9 +44,16 @@
|
||||
|
||||
async function loadSponsor(){
|
||||
try{
|
||||
var r=await fetch('/api/public/current-sponsor'); var j=await r.json(); var sp=j&&j.sponsor;
|
||||
// personal invite: ?ref=<id> -> place in that member's leg via the site's moving-link joinTarget
|
||||
var ref=new URLSearchParams(location.search).get('ref');
|
||||
if(ref&&/^\d{1,15}$/.test(ref)){
|
||||
try{ var rm=await (await fetch('/api/public/member?id='+ref)).json(); var t=rm&&rm.joinTarget;
|
||||
if(t&&t.id){ sponsorId=String(t.id); $('sponsorLine').innerHTML='You’ll join under <strong>#'+t.id+'</strong>'+(String(t.id)!==String(ref)?' — the next open spot in #'+ref+'’s team':'')+'.'; return; }
|
||||
}catch(e){}
|
||||
}
|
||||
var j=await (await fetch('/api/public/current-sponsor')).json(); var sp=j&&j.sponsor;
|
||||
if(sp&&sp.id){ sponsorId=String(sp.id); $('sponsorLine').innerHTML='You’ll join the team under <strong>#'+sp.id+(sp.name?' ('+sp.name+')':'')+'</strong> — the current team placement.'; }
|
||||
else { $('sponsorLine').textContent='Loading the current team placement…'; }
|
||||
else $('sponsorLine').textContent='Loading the current team placement…';
|
||||
}catch(e){ $('sponsorLine').textContent='Could not load the current sponsor — please refresh.'; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user