From b94241b82a16eb817a952c974073284a21c379ae Mon Sep 17 00:00:00 2001 From: ardocrat Date: Thu, 30 Apr 2026 13:53:44 +0300 Subject: [PATCH] wallet: select external connection by default on creation if integrated node is not running --- src/gui/views/wallets/wallet/settings/connection.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/views/wallets/wallet/settings/connection.rs b/src/gui/views/wallets/wallet/settings/connection.rs index 4064f51..6beaba2 100644 --- a/src/gui/views/wallets/wallet/settings/connection.rs +++ b/src/gui/views/wallets/wallet/settings/connection.rs @@ -21,6 +21,7 @@ use crate::gui::views::network::ConnectionsContent; use crate::gui::views::types::{ContentContainer, ModalPosition}; use crate::gui::views::{Modal, View}; use crate::gui::Colors; +use crate::node::Node; use crate::wallet::types::ConnectionMethod; use crate::wallet::{ConnectionsConfig, ExternalConnection}; @@ -35,8 +36,17 @@ pub struct ConnectionSettings { impl Default for ConnectionSettings { fn default() -> Self { + let method = { + let ext_conn_list = ConnectionsConfig::ext_conn_list(); + if Node::is_running() || Node::is_starting() || ext_conn_list.is_empty() { + ConnectionMethod::Integrated + } else { + let ext_conn = ext_conn_list.get(0).unwrap(); + ConnectionMethod::External(ext_conn.id, ext_conn.url.clone()) + } + }; Self { - method: ConnectionMethod::Integrated, + method, ext_conn_modal: ExternalConnectionModal::new(None), } }