Revert CTA always-rebuild, keep combined text detection for RMD quality

The always-rebuild approach caused the CTA to disappear when the observer
fired a second time. Reverted to only rebuild on FRN change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-04-28 03:31:12 -05:00
parent 31a84b95e3
commit c0adeec663

View file

@ -409,12 +409,11 @@ Send reset link
// Remediation CTA — rebuild if FRN changed (user searched new company) // Remediation CTA — rebuild if FRN changed (user searched new company)
var currentFrn = (document.getElementById("entity-frn").textContent || "").replace(/\D/g, ""); var currentFrn = (document.getElementById("entity-frn").textContent || "").replace(/\D/g, "");
var existingCta = document.getElementById("pw-remediation-cta"); var existingCta = document.getElementById("pw-remediation-cta");
if (existingCta) { if (existingCta && existingCta.dataset.frn && existingCta.dataset.frn !== currentFrn) {
// Remove CTA if FRN changed or if we need to rebuild
existingCta.remove(); existingCta.remove();
existingCta = null; existingCta = null;
} }
{ if (!existingCta) {
var actionCards = checks.querySelectorAll(":scope > .bg-red-50, :scope > .bg-amber-50"); var actionCards = checks.querySelectorAll(":scope > .bg-red-50, :scope > .bg-amber-50");
if (actionCards.length > 0) { if (actionCards.length > 0) {
var services = []; var services = [];