Skip to content

Commit d0e8a5e

Browse files
committed
fix psbts panel: keep list of psbts in background
fix this comment: #959 (comment) new_preselected is changed for a preselect method that keeps the current state of the psbts list panel and open the modal with the selected psbt.
1 parent e55b198 commit d0e8a5e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

gui/src/app/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl App {
161161
.list_spend_transactions(Some(&[*txid]))
162162
.map(|txs| txs.first().cloned())
163163
{
164-
self.panels.psbts = PsbtsPanel::new_preselected(self.wallet.clone(), spend_tx);
164+
self.panels.psbts.preselect(spend_tx);
165165
self.panels.current = menu;
166166
return Command::none();
167167
};

gui/src/app/state/psbts.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,11 @@ impl PsbtsPanel {
3434
}
3535
}
3636

37-
pub fn new_preselected(wallet: Arc<Wallet>, spend_tx: SpendTx) -> Self {
38-
let psbt_state = psbt::PsbtState::new(wallet.clone(), spend_tx.clone(), true);
39-
40-
Self {
41-
wallet,
42-
spend_txs: vec![spend_tx],
43-
warning: None,
44-
selected_tx: Some(psbt_state),
45-
import_tx: None,
46-
}
37+
pub fn preselect(&mut self, spend_tx: SpendTx) {
38+
let psbt_state = psbt::PsbtState::new(self.wallet.clone(), spend_tx.clone(), true);
39+
self.selected_tx = Some(psbt_state);
40+
self.warning = None;
41+
self.import_tx = None;
4742
}
4843
}
4944

0 commit comments

Comments
 (0)