From afce3a3dddef88e9887ad173de143dcd251012ad Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 23 Jun 2026 10:42:41 -0300 Subject: [PATCH] =?UTF-8?q?Fix=20chat=20on=20pages=20without=20pricing=20s?= =?UTF-8?q?ection=20=E2=80=94=20guard=20pricing-period=20element=20access?= =?UTF-8?q?=20in=20script.js=20to=20prevent=20TDZ=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/script.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index aee8a6b..d13ac13 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -283,10 +283,11 @@ function updatePeriodDisplay() { ? "/ month ✦ yearly" : "/ month"; } -document - .getElementById("pricing-period") - .addEventListener("change", updatePeriodDisplay); -updatePeriodDisplay(); // fire on load so yearly bonuses show by default +const pricingPeriod = document.getElementById("pricing-period"); +if (pricingPeriod) { + pricingPeriod.addEventListener("change", updatePeriodDisplay); + updatePeriodDisplay(); // fire on load so yearly bonuses show by default +} const SERVER_WEBHOOK = "https://n8n.derez.ai/webhook/server"; initServerLocations(); // fetch live server availability