From 69a59712660a668cb7a10b276f3c7fc45606eb3d Mon Sep 17 00:00:00 2001 From: qwcan Date: Mon, 29 Sep 2025 16:56:09 -0500 Subject: [PATCH] Wait for settings to open before clicking the allAtOnceCheckbox --- umalauncher/carrotjuicer.py | 17 +++++++++++++---- umalauncher/version.py | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/umalauncher/carrotjuicer.py b/umalauncher/carrotjuicer.py index 37a5b33..a25db91 100644 --- a/umalauncher/carrotjuicer.py +++ b/umalauncher/carrotjuicer.py @@ -885,10 +885,19 @@ def setup_helper_page(browser: horsium.BrowserWindow): # Enable all cards browser.execute_script("""document.querySelector("[class^='filters_settings_button_']").click()""") - all_cards_enabled = browser.execute_script("""return document.getElementById("allAtOnceCheckbox").checked;""") - if not all_cards_enabled: - browser.execute_script("""document.getElementById("allAtOnceCheckbox").click()""") - browser.execute_script("""document.querySelector("[class^='filters_confirm_button_']").click()""") + #TODO: The webdriver code should probably be refactored to handle waits better + timeout = 3 + while not browser.execute_script("""return document.getElementById("allAtOnceCheckbox");"""): + time.sleep(0.125) + timeout -= 0.125 + if timeout <= 0: + logger.error("Timeout waiting for allAtOnceCheckbox to appear.") + break + if timeout > 0: + all_cards_enabled = browser.execute_script("""return document.getElementById("allAtOnceCheckbox").checked;""") + if not all_cards_enabled: + browser.execute_script("""document.getElementById("allAtOnceCheckbox").click()""") + browser.execute_script("""document.querySelector("[class^='filters_confirm_button_']").click()""") gametora_remove_cookies_banner(browser) gametora_close_ad_banner( browser ) diff --git a/umalauncher/version.py b/umalauncher/version.py index e7bc93e..975296e 100644 --- a/umalauncher/version.py +++ b/umalauncher/version.py @@ -11,7 +11,7 @@ import gui import glob -VERSION = "1.16.10" +VERSION = "1.16.11" def parse_version(version_string: str): """Convert version string to tuple."""