Add alias to confirmation message of delete wallet modal

close #1763
This commit is contained in:
edouardparis 2025-07-07 10:27:32 +02:00
parent 162feff179
commit 612608616b

View File

@ -485,10 +485,18 @@ impl DeleteWalletModal {
)); ));
} }
// Use separate `Row`s for help text in order to have better spacing. // Use separate `Row`s for help text in order to have better spacing.
let help_text_1 = format!( let help_text_1 = if let Some(alias) = &self.wallet_settings.alias {
"Are you sure you want to delete the configuration and all associated data for the wallet Liana-{}?", format!(
&self.wallet_settings.descriptor_checksum, "Are you sure you want to delete the configuration and all associated data for the wallet {} (Liana-{})?",
); alias,
self.wallet_settings.descriptor_checksum
)
} else {
format!(
"Are you sure you want to delete the configuration and all associated data for the wallet Liana-{}?",
&self.wallet_settings.descriptor_checksum,
)
};
let help_text_2 = match self.internal_bitcoind { let help_text_2 = match self.internal_bitcoind {
Some(true) => Some("(The Liana-managed Bitcoin node for this network will not be affected by this action.)"), Some(true) => Some("(The Liana-managed Bitcoin node for this network will not be affected by this action.)"),
Some(false) => None, Some(false) => None,
@ -501,10 +509,17 @@ impl DeleteWalletModal {
Column::new() Column::new()
.spacing(10) .spacing(10)
.push(Container::new( .push(Container::new(
h4_bold(format!( h4_bold(if let Some(alias) = &self.wallet_settings.alias {
"Delete configuration for Liana-{}", format!(
&self.wallet_settings.descriptor_checksum "Delete configuration for {} (Liana-{})",
)) alias, &self.wallet_settings.descriptor_checksum
)
} else {
format!(
"Delete configuration for Liana-{}",
&self.wallet_settings.descriptor_checksum
)
})
.style(theme::text::destructive) .style(theme::text::destructive)
.width(Length::Fill), .width(Length::Fill),
)) ))