Fix Phase-by-Phase money columns to phase totals (x cycles); null-guard removed heroSignupBtn that crashed init() on every load

This commit is contained in:
Claude (via Marty)
2026-07-30 21:58:37 +00:00
parent 7433b59a8f
commit 4e2d97af56
+8 -4
View File
@@ -1746,13 +1746,15 @@ ${numPeople > 0 ? `
}
}
const cls = k === '3xL7' ? 'endgame' : (k === roiRow ? 'highlight' : '');
// Phase totals (x cycles) so every money column matches the Cycles column;
// per-cycle values here kept getting read as phase totals (Marty 07-30).
rows += `<tr class="${cls}">
<td>${p.label}</td>
<td class="num">${k === '3xL7' ? 'every 19d' : `${cyclesNum}×`}</td>
<td>${k === '3xL7' ? 'ongoing' : `~${p.months} months`}</td>
<td class="num">$${p.payout.toFixed(2)}</td>
<td class="num">$${p.profit.toFixed(2)}</td>
<td class="num green-text referral-col">$${yourCut.toFixed(2)}</td>
<td class="num">$${(p.payout * cyclesNum).toFixed(2)}</td>
<td class="num">$${(p.profit * cyclesNum).toFixed(2)}</td>
<td class="num green-text referral-col">$${(yourCut * cyclesNum).toFixed(2)}</td>
<td class="num referral-col">$${cumRunning.toFixed(2)}</td>
</tr>`;
}
@@ -2093,9 +2095,11 @@ document.getElementById('heroCalcBtn').addEventListener('click', scrollToCalcula
// Hero signup button — same logic as calculator signup
function updateHeroSignupBtn() {
// #heroSignupBtn was removed in a redesign; unguarded .href crashed init()
// on every load (and killed updateSharedLinkBox below it). Guard it.
const refUser = getRefFromURL() || 'cryptoteambuild';
const btn = document.getElementById('heroSignupBtn');
btn.href = `https://clickbaitpays.me/?ref=${refUser}`;
if (btn) btn.href = `https://clickbaitpays.me/?ref=${refUser}`;
}
// Auto-open calculator if ?calc=1 in URL