From d3a7bf967e4dce3cc45699bdeb37d5d4c4814bc8 Mon Sep 17 00:00:00 2001 From: Jai A Date: Sun, 3 Nov 2024 23:50:55 -0700 Subject: [PATCH] kill ads loop after 10s --- apps/frontend/src/public/promo-frame.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/public/promo-frame.html b/apps/frontend/src/public/promo-frame.html index 46377d2e4..a5186e4c7 100644 --- a/apps/frontend/src/public/promo-frame.html +++ b/apps/frontend/src/public/promo-frame.html @@ -107,13 +107,17 @@ }); }); + let attempts = 0; function syncAgreeState() { const primaryButton = document.querySelector('[mode="primary"]'); if (primaryButton) { primaryButton.click(); } else { - setTimeout(syncAgreeState, 100); + attempts++; + if (attempts < 10) { + setTimeout(syncAgreeState, 1000); + } } } syncAgreeState();