Fix: referral column visibility now respects checkbox, not just numPeople

- The second toggle block (lines 1718-1725) was overriding the checkbox state
- When numPeople > 0, it was showing sponsor columns regardless of checkbox
- Now uses  so both conditions must be met
- Referral columns stay hidden by default even when simulating a referral plan
This commit is contained in:
Marty Bostick
2026-07-30 21:50:36 +00:00
parent 69a6de26ef
commit 7433b59a8f
+4 -3
View File
@@ -1715,13 +1715,14 @@ ${numPeople > 0 ? `
`;
document.getElementById('summaryCards').innerHTML = summaryHtml;
// Toggle referral columns when no people in downline
// Toggle referral columns when no people in downline, but respect checkbox
const shouldShow = (numPeople > 0) && showRef;
for (const id of ['headerYourCut','headerCumulative','headerTimelineComm','headerTimelineCum']) {
const el = document.getElementById(id);
if (el) el.style.display = numPeople > 0 ? '' : 'none';
if (el) el.style.display = shouldShow ? '' : 'none';
}
for (const el of document.querySelectorAll('.referral-col')) {
el.style.display = numPeople > 0 ? '' : 'none';
el.style.display = shouldShow ? '' : 'none';
}
let cumRunning = 0;