From 1cbbb8c0befe3c168fbbd34129a2f4f2a8c8726f Mon Sep 17 00:00:00 2001 From: edouardparis Date: Mon, 30 Oct 2023 13:26:21 +0100 Subject: [PATCH] wallet: load name from settings --- gui/src/app/wallet.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui/src/app/wallet.rs b/gui/src/app/wallet.rs index 02f4593b..105441ad 100644 --- a/gui/src/app/wallet.rs +++ b/gui/src/app/wallet.rs @@ -48,6 +48,11 @@ impl Wallet { } } + pub fn with_name(mut self, name: String) -> Self { + self.name = name; + self + } + pub fn with_key_aliases(mut self, aliases: HashMap) -> Self { self.keys_aliases = aliases; self @@ -101,7 +106,8 @@ impl Wallet { let mut wallet = match settings::Settings::from_file(datadir_path.to_path_buf(), network) { Ok(settings) => { if let Some(wallet_setting) = settings.wallets.first() { - self.with_hardware_wallets(wallet_setting.hardware_wallets.clone()) + self.with_name(wallet_setting.name.clone()) + .with_hardware_wallets(wallet_setting.hardware_wallets.clone()) .with_key_aliases(wallet_setting.keys_aliases()) } else { self.with_hardware_wallets(gui_config_hws)