fix settings

This commit is contained in:
2026-06-10 14:51:44 +07:00
parent 5edc8d311e
commit e95cc5967f
2 changed files with 10 additions and 12 deletions

View File

@@ -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();