Join: let chosen positions default to direct placement

The moving link is team-first by design: it routes a new join to whoever needs
directs next, so the position whose link was actually clicked earns no entry
reward. Measured on #21 that came to 80 joins in seven days and zero entry
rewards, while the traffic paying for those joins was the owner's.

For a position being deliberately built out, that default is backwards. Any ID
listed in the new directDefaultIds config now behaves as ?direct=1 on its own
/join/<id> link - including every promo tool, flyer QR and downline-builder
entry that resolves through it - without needing the parameter appended.

?direct=0 still forces rotation for a single share, so the team-first behaviour
stays available rather than being replaced.

Config rather than hard-coded, and editable from the admin settings form, so
which positions get this can change without a deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-31 10:29:55 -05:00
parent 34480d444e
commit 7e390aa48e
5 changed files with 25 additions and 5 deletions
+6 -1
View File
@@ -13,7 +13,11 @@
// Direct link (?direct=1): opt out of moving-link rotation — new joins land
// directly under THIS position (spillover in their team), instead of routing
// to the next-to-qualify member. Default (no flag) = the Team/moving link.
const direct=new URLSearchParams(location.search).get('direct')==='1';
const _dq=new URLSearchParams(location.search).get('direct');
// ?direct=1 forces direct placement, ?direct=0 forces rotation. With
// neither, the position's own configured default decides (applied once
// the member data arrives, below).
let direct=_dq==='1';
let joinTargetId=id; // where the entry actually lands after moving-link routing
function setIds(idStr){
@@ -57,6 +61,7 @@
// Moving-link routing: the entry lands on whoever the smart link resolves to.
// A qualified inviter's link routes to the next-to-qualify in their leg, so
// the join builds the team down in order instead of spilling onto the inviter.
if(_dq!=='1'&&_dq!=='0'&&d.directDefault) direct=true;
const t=direct?{id:id,reason:'direct'}:(d.joinTarget||{id:d.id,referralUrl:d.referralUrl,reason:'self'});
joinTargetId=t.id;
const jb=document.getElementById('joinBtn');