diff --git a/src/sticker_convert/cli.py b/src/sticker_convert/cli.py index 1a831eed..97996d6d 100755 --- a/src/sticker_convert/cli.py +++ b/src/sticker_convert/cli.py @@ -436,6 +436,7 @@ def get_opt_cred(self, args: Namespace) -> CredOption: if args.signal_get_auth: m = GetSignalAuth(cb_msg=self.cb.msg, cb_ask_str=self.cb.ask_str) + m.launch_signal_desktop() uuid, password = None, None while True: diff --git a/src/sticker_convert/gui_components/windows/signal_get_auth_window.py b/src/sticker_convert/gui_components/windows/signal_get_auth_window.py index 23001355..a564dc3e 100644 --- a/src/sticker_convert/gui_components/windows/signal_get_auth_window.py +++ b/src/sticker_convert/gui_components/windows/signal_get_auth_window.py @@ -69,6 +69,7 @@ def cb_login(self): def cb_login_thread(self, *args: Any): m = GetSignalAuth(cb_msg=self.gui.cb_msg, cb_ask_str=self.cb_ask_str_signal) + m.launch_signal_desktop() uuid, password = None, None while Toplevel.winfo_exists(self): diff --git a/src/sticker_convert/utils/auth/get_signal_auth.py b/src/sticker_convert/utils/auth/get_signal_auth.py index 42dde43a..cfae0882 100755 --- a/src/sticker_convert/utils/auth/get_signal_auth.py +++ b/src/sticker_convert/utils/auth/get_signal_auth.py @@ -99,6 +99,8 @@ def get_local_chromedriver( chromedriver_which = shutil.which("chromedriver") if chromedriver_which: chromedriver_path = Path(chromedriver_which) + else: + chromedriver_path = None if chromedriver_path: status, output_str = RunBin.run_cmd( @@ -205,11 +207,6 @@ def launch_signal( self.driver = webdriver.Chrome(options=options, service=service) def get_cred(self) -> tuple[Optional[str], Optional[str]]: - success = self.launch_signal_desktop() - - if not success: - return None, None - # https://stackoverflow.com/a/73456344 uuid: Optional[str] = None password: Optional[str] = None @@ -231,8 +228,8 @@ def get_cred(self) -> tuple[Optional[str], Optional[str]]: except JavascriptException: pass - assert isinstance(uuid, str) - assert isinstance(password, str) + assert uuid is None or isinstance(uuid, str) + assert password is None or isinstance(password, str) return uuid, password def close(self):