Qualified dashboards promote the next unqualified position in their leg
Instead of only pointing at the team rotator, a qualified member's share card now runs the moving-link wave automatically: breadth-first, left-to-right, the first position below them with fewer than 2 directs becomes "next in line" — their QR, page link, and join CTA all carry that position's ID. When it qualifies, the card rotates to the next one. Falls back to the team rotator when the whole leg is qualified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -438,6 +438,17 @@ async function memberPublic(id) {
|
||||
out.income = inc.map(p => ({ fromId: p.fromId, pol: p.pol, ts: p.ts, desc: describeIncome(p.fromTier, p.level, p.pol) })).reverse().slice(0, 50);
|
||||
} catch (e) { out.income = []; }
|
||||
out.subtree = getSubtree(id, 99); // full leg — the dashboard drills down client-side
|
||||
// moving-link automation: the first position below (breadth-first, left→right)
|
||||
// that still needs directs is where a qualified member's effort goes next
|
||||
if (out.subtree) {
|
||||
const q = [out.subtree.left, out.subtree.right].filter(Boolean);
|
||||
while (q.length) {
|
||||
const n = q.shift();
|
||||
if ((n.directCount || 0) < 2) { out.nextInLine = { id: n.id, directCount: n.directCount || 0, levelName: n.levelName }; break; }
|
||||
if (n.left) q.push(n.left);
|
||||
if (n.right) q.push(n.right);
|
||||
}
|
||||
}
|
||||
const chain = [];
|
||||
const seen = new Set([id]);
|
||||
let cur = m.uplineId;
|
||||
|
||||
Reference in New Issue
Block a user