From c741ba26cc57e804e095e87ada42d26e7a71ee86 Mon Sep 17 00:00:00 2001 From: Jai A Date: Thu, 21 Nov 2024 13:06:18 -0800 Subject: [PATCH] add sync agree state --- .../frontend/src/public/promo-frame-rev-iq.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/frontend/src/public/promo-frame-rev-iq.html b/apps/frontend/src/public/promo-frame-rev-iq.html index f4d142e7e..daa2bd8de 100644 --- a/apps/frontend/src/public/promo-frame-rev-iq.html +++ b/apps/frontend/src/public/promo-frame-rev-iq.html @@ -79,6 +79,23 @@ origin: "https://modrinth.com", }); }); + + let attempts = 0; + function syncAgreeState() { + const primaryButton = document.querySelector( + ".qc-cmp2-summary-buttons button:last-of-type", + ); + + if (primaryButton) { + primaryButton.click(); + } else { + attempts++; + if (attempts < 10) { + setTimeout(syncAgreeState, 1000); + } + } + } + syncAgreeState();