fix psbts panel: keep list of psbts in background
fix this comment: https://github.com/wizardsardine/liana/pull/959#issuecomment-1964811858 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.
This commit is contained in:
parent
a6832ad0b7
commit
2995df870f
@ -161,7 +161,7 @@ impl App {
|
||||
.list_spend_transactions(Some(&[*txid]))
|
||||
.map(|txs| txs.first().cloned())
|
||||
{
|
||||
self.panels.psbts = PsbtsPanel::new_preselected(self.wallet.clone(), spend_tx);
|
||||
self.panels.psbts.preselect(spend_tx);
|
||||
self.panels.current = menu;
|
||||
return Command::none();
|
||||
};
|
||||
|
||||
@ -34,16 +34,11 @@ impl PsbtsPanel {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_preselected(wallet: Arc<Wallet>, spend_tx: SpendTx) -> Self {
|
||||
let psbt_state = psbt::PsbtState::new(wallet.clone(), spend_tx.clone(), true);
|
||||
|
||||
Self {
|
||||
wallet,
|
||||
spend_txs: vec![spend_tx],
|
||||
warning: None,
|
||||
selected_tx: Some(psbt_state),
|
||||
import_tx: None,
|
||||
}
|
||||
pub fn preselect(&mut self, spend_tx: SpendTx) {
|
||||
let psbt_state = psbt::PsbtState::new(self.wallet.clone(), spend_tx, true);
|
||||
self.selected_tx = Some(psbt_state);
|
||||
self.warning = None;
|
||||
self.import_tx = None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user