Restart new spending process on user demand

This commit is contained in:
edouardparis 2024-02-26 15:13:23 +01:00
parent ed363963b3
commit 2d2cd12bda
2 changed files with 15 additions and 0 deletions

View File

@ -177,6 +177,17 @@ impl App {
self.cache.network,
);
}
menu::Menu::CreateSpendTx => {
// redo the process of spending only if user want to start a new one.
if !self.panels.create_spend.is_first_step() {
self.panels.create_spend = CreateSpendPanel::new(
self.wallet.clone(),
&self.cache.coins,
self.cache.blockheight as u32,
self.cache.network,
);
}
}
_ => {}
};
self.panels.current = menu;

View File

@ -63,6 +63,10 @@ impl CreateSpendPanel {
],
}
}
pub fn is_first_step(&self) -> bool {
self.current == 0
}
}
impl State for CreateSpendPanel {