Skip to content

Commit

Permalink
kill ads loop after 10s
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Nov 4, 2024
1 parent db145cd commit d3a7bf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/frontend/src/public/promo-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d3a7bf9

Please sign in to comment.