diff --git a/site/public/tools/fcc-compliance-check/index.html b/site/public/tools/fcc-compliance-check/index.html index 94fa545..14b6f76 100644 --- a/site/public/tools/fcc-compliance-check/index.html +++ b/site/public/tools/fcc-compliance-check/index.html @@ -409,23 +409,26 @@ Send reset link // Remediation CTA — rebuild if FRN changed (user searched new company) var currentFrn = (document.getElementById("entity-frn").textContent || "").replace(/\D/g, ""); var existingCta = document.getElementById("pw-remediation-cta"); - if (existingCta && existingCta.dataset.frn && existingCta.dataset.frn !== currentFrn) { + if (existingCta) { + // Remove CTA if FRN changed or if we need to rebuild existingCta.remove(); existingCta = null; } - if (!existingCta) { + { var actionCards = checks.querySelectorAll(":scope > .bg-red-50, :scope > .bg-amber-50"); if (actionCards.length > 0) { var services = []; actionCards.forEach(function(rc) { - var t = rc.textContent; + var t = rc.textContent || ""; var lbl = rc.querySelector("p") ? rc.querySelector("p").textContent : ""; - if (lbl.indexOf("CPNI") >= 0) services.push("cpni"); - else if (lbl.indexOf("499-Q") >= 0) services.push("499q"); - else if (lbl.indexOf("499-A") >= 0) services.push("499a"); - else if (lbl.indexOf("RMD") >= 0 && services.indexOf("rmd") < 0) services.push("rmd"); - else if (lbl.indexOf("STIR") >= 0) services.push("stir"); - else if (lbl.indexOf("Broadband") >= 0 || lbl.indexOf("BDC") >= 0) services.push("bdc"); + // Check both label and full text to catch quality sub-checks + var combined = lbl + " " + t; + if (combined.indexOf("CPNI") >= 0) services.push("cpni"); + else if (combined.indexOf("499-Q") >= 0) services.push("499q"); + else if (combined.indexOf("499-A") >= 0 && services.indexOf("499a") < 0) services.push("499a"); + else if (combined.indexOf("RMD") >= 0 && services.indexOf("rmd") < 0) services.push("rmd"); + else if (combined.indexOf("STIR") >= 0) services.push("stir"); + else if ((combined.indexOf("Broadband") >= 0 || combined.indexOf("BDC") >= 0) && services.indexOf("bdc") < 0) services.push("bdc"); }); if (services.length > 0) { var hasBdcQuestion = !!checks.querySelector(".pw-bdc-toggle");