Skip to content

Commit

Permalink
gui: do not let user try recovery if one block left
Browse files Browse the repository at this point in the history
  • Loading branch information
pythcoiner committed Jul 23, 2024
1 parent ee9cfb9 commit 9b50fd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gui/src/app/state/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn recovery_paths(wallet: &Wallet, coins: &[Coin], blockheight: i32) -> Vec<Reco
.iter()
.filter(|coin| {
coin.spend_info.is_none()
&& remaining_sequence(coin, blockheight as u32, sequence) <= 1
&& remaining_sequence(coin, blockheight as u32, sequence) < 1
})
.fold(
(0, Amount::from_sat(0)),
Expand Down
12 changes: 8 additions & 4 deletions gui/src/app/view/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ pub fn recovery<'a>(
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 are available, select one:",
recovery_paths.len()
)
}))
.push(Column::with_children(recovery_paths).spacing(20)),
)
.style(theme::Container::Card(theme::Card::Simple))
Expand Down

0 comments on commit 9b50fd3

Please sign in to comment.