From e95cc5967fb0e2a36fbcecf30e75d296e4d8c041 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Wed, 10 Jun 2026 14:51:44 +0700 Subject: [PATCH] fix settings --- crates/relay_auth/src/lib.rs | 19 ++++++++----------- crates/settings/src/lib.rs | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/crates/relay_auth/src/lib.rs b/crates/relay_auth/src/lib.rs index 13ed5ca..8d32e61 100644 --- a/crates/relay_auth/src/lib.rs +++ b/crates/relay_auth/src/lib.rs @@ -282,18 +282,15 @@ impl RelayAuth { // Clear pending events for the authenticated relay this.clear_pending_events(url, cx); - // Only show the success notification if the relay was not already trusted - if !settings.read(cx).trusted_relay(url, cx) { - let domain = url.domain().unwrap_or_default(); - let msg = format!("Relay {} has been authenticated", domain); + let domain = url.domain().unwrap_or_default(); + let msg = format!("Relay {} has been authenticated", domain); - window.push_notification(Notification::success(msg), cx); - } else { - // Save the authenticated relay to automatically authenticate future requests - settings.update(cx, |this, cx| { - this.add_trusted_relay(url, cx); - }); - } + window.push_notification(Notification::success(msg), cx); + + // Save the authenticated relay to automatically authenticate future requests + settings.update(cx, |this, cx| { + this.add_trusted_relay(url, cx); + }); } }) .ok(); diff --git a/crates/settings/src/lib.rs b/crates/settings/src/lib.rs index e88660f..e450a1c 100644 --- a/crates/settings/src/lib.rs +++ b/crates/settings/src/lib.rs @@ -327,7 +327,8 @@ impl AppSettings { .iter() .any(|relay| relay == url.as_str_without_trailing_slash()) { - this.trusted_relays.push(url.to_string()); + this.trusted_relays + .push(url.as_str_without_trailing_slash().to_string()); cx.notify(); } });