diff --git a/gui/src/app/mod.rs b/gui/src/app/mod.rs index 82720a95..8ebaa766 100644 --- a/gui/src/app/mod.rs +++ b/gui/src/app/mod.rs @@ -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; diff --git a/gui/src/app/state/spend/mod.rs b/gui/src/app/state/spend/mod.rs index 6a01a821..6bdf833b 100644 --- a/gui/src/app/state/spend/mod.rs +++ b/gui/src/app/state/spend/mod.rs @@ -63,6 +63,10 @@ impl CreateSpendPanel { ], } } + + pub fn is_first_step(&self) -> bool { + self.current == 0 + } } impl State for CreateSpendPanel {