From f3f74a8da732d10104181bd4b2cda44b99d44ab6 Mon Sep 17 00:00:00 2001 From: pythcoiner Date: Thu, 27 Jun 2024 07:47:24 +0200 Subject: [PATCH] gui: do not let user try recovery if one block left --- gui/src/app/state/recovery.rs | 2 +- gui/src/app/view/recovery.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gui/src/app/state/recovery.rs b/gui/src/app/state/recovery.rs index 09298aaff..0a45543f7 100644 --- a/gui/src/app/state/recovery.rs +++ b/gui/src/app/state/recovery.rs @@ -247,7 +247,7 @@ fn recovery_paths(wallet: &Wallet, coins: &[Coin], blockheight: i32) -> Vec( Container::new( Column::new() .spacing(20) - .push(text(format!( - "{} recovery paths will be available at the next block, select one:", - recovery_paths.len() - ))) + .push(text(if recovery_paths.len() == 1 { + "1 recovery path is available, please select:".to_string() + } else { + format!( + "{} recovery paths will be available, select one:", + recovery_paths.len() + ) + })) .push(Column::with_children(recovery_paths).spacing(20)), ) .style(theme::Container::Card(theme::Card::Simple))