From dc539bf37392f7d21c207644a23faca1d67449bf Mon Sep 17 00:00:00 2001 From: gitRaiku Date: Fri, 21 Feb 2025 21:48:28 +0200 Subject: [PATCH 1/2] Alleviate browser blocking oauth socket from creating --- psst-gui/src/ui/preferences.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/psst-gui/src/ui/preferences.rs b/psst-gui/src/ui/preferences.rs index 8cb77d0c..d6fcf0fb 100644 --- a/psst-gui/src/ui/preferences.rs +++ b/psst-gui/src/ui/preferences.rs @@ -332,11 +332,6 @@ impl> Controller for Authenticate { data.preferences.auth.result.defer_default(); let (auth_url, pkce_verifier) = oauth::generate_auth_url(8888); - if open::that(&auth_url).is_err() { - data.error_alert("Failed to open browser"); - return; - } - let config = data.preferences.auth.session_config(); let widget_id = ctx.widget_id(); let event_sink = ctx.get_external_handle(); @@ -388,6 +383,11 @@ impl> Controller for Authenticate { }); self.thread.replace(thread); ctx.set_handled(); + + if open::that(&auth_url).is_err() { + data.error_alert("Failed to open browser"); + return; + } } Event::Command(cmd) if cmd.is(Self::RESPONSE) => { self.thread.take(); From aedd391464c98eb033209fa4aff10557382e5cd4 Mon Sep 17 00:00:00 2001 From: Pintilie Sebastian Marian Date: Fri, 21 Feb 2025 23:28:31 +0200 Subject: [PATCH 2/2] Remove unneded return --- psst-gui/src/ui/preferences.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/psst-gui/src/ui/preferences.rs b/psst-gui/src/ui/preferences.rs index d6fcf0fb..27548342 100644 --- a/psst-gui/src/ui/preferences.rs +++ b/psst-gui/src/ui/preferences.rs @@ -386,7 +386,6 @@ impl> Controller for Authenticate { if open::that(&auth_url).is_err() { data.error_alert("Failed to open browser"); - return; } } Event::Command(cmd) if cmd.is(Self::RESPONSE) => {