Hide AI recommendation from results view; keep DB capture
AI text is still generated and saved to calc_submissions for internal follow-up, but no longer displayed to the user — keeps the detailed analysis behind the product sign-up wall. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
14
app.js
14
app.js
@@ -129,9 +129,9 @@
|
||||
ai += `This would represent entirely new interest income for your community at no additional risk.`;
|
||||
}
|
||||
|
||||
// ── AI recommendation — call server; fall back to client-side text ──
|
||||
// ── AI recommendation — call server to generate & save to DB (not displayed) ──
|
||||
try {
|
||||
const aiRes = await fetch('/api/calculate', {
|
||||
await fetch('/api/calculate', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -140,15 +140,7 @@
|
||||
totalPotential, opInterest, resInterest,
|
||||
}),
|
||||
});
|
||||
if (aiRes.ok) {
|
||||
const { recommendation } = await aiRes.json();
|
||||
document.getElementById('calcAiText').textContent = recommendation;
|
||||
} else {
|
||||
document.getElementById('calcAiText').textContent = ai;
|
||||
}
|
||||
} catch (_) {
|
||||
document.getElementById('calcAiText').textContent = ai;
|
||||
}
|
||||
} catch (_) { /* best-effort — DB save failed silently */ }
|
||||
|
||||
// ── Animate the main number ──
|
||||
animateValue(document.getElementById('resultAmount'), 0, totalPotential);
|
||||
|
||||
@@ -532,10 +532,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="calc-ai-bubble">
|
||||
<span class="ai-label">✦ HOA LedgerIQ AI Estimate</span>
|
||||
<p id="calcAiText"></p>
|
||||
</div>
|
||||
<!-- AI text captured to DB only — not displayed -->
|
||||
<p id="calcAiText" style="display:none"></p>
|
||||
|
||||
<div class="calc-refine-blurb">
|
||||
<span class="calc-refine-icon">⚙</span>
|
||||
|
||||
Reference in New Issue
Block a user