Fix chat on pages without pricing section — guard pricing-period element access in script.js to prevent TDZ crash
This commit is contained in:
+4
-3
@@ -283,10 +283,11 @@ function updatePeriodDisplay() {
|
|||||||
? "/ month ✦ yearly"
|
? "/ month ✦ yearly"
|
||||||
: "/ month";
|
: "/ month";
|
||||||
}
|
}
|
||||||
document
|
const pricingPeriod = document.getElementById("pricing-period");
|
||||||
.getElementById("pricing-period")
|
if (pricingPeriod) {
|
||||||
.addEventListener("change", updatePeriodDisplay);
|
pricingPeriod.addEventListener("change", updatePeriodDisplay);
|
||||||
updatePeriodDisplay(); // fire on load so yearly bonuses show by default
|
updatePeriodDisplay(); // fire on load so yearly bonuses show by default
|
||||||
|
}
|
||||||
const SERVER_WEBHOOK = "https://n8n.derez.ai/webhook/server";
|
const SERVER_WEBHOOK = "https://n8n.derez.ai/webhook/server";
|
||||||
initServerLocations(); // fetch live server availability
|
initServerLocations(); // fetch live server availability
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user