Merge #1016: gui: clear RBF modal if selected transaction changes

afd55299ed2fda5d2ee19232cb6c67397acd9b49 gui: clear rbf modal for different tx (jp1ac4)

Pull request description:

  As a follow-up to #959, this clears the RBF modal if the selected transaction changes. e.g. after going to the replacement transaction from the RBF modal and then returning to the Transactions panel and selecting a different transaction.

ACKs for top commit:
  edouardparis:
    ACK afd55299ed2fda5d2ee19232cb6c67397acd9b49

Tree-SHA512: f04c88941c162b08239efc4f9428bac7ebd0f9488229a6a454285cde8da61f1bd1b9aa58662c84a4f152d4c80fd06812201defd092fd294292289249fba0ef94
This commit is contained in:
edouardparis 2024-03-22 10:33:13 +01:00
commit 5527e635a6
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F

View File

@ -130,6 +130,14 @@ impl State for TransactionsPanel {
} else { } else {
self.txs.get(i - self.pending_txs.len()).cloned() self.txs.get(i - self.pending_txs.len()).cloned()
}; };
// Clear modal if it's for a different tx.
if let Some(modal) = &self.create_rbf_modal {
if Some(modal.tx.tx.txid())
!= self.selected_tx.as_ref().map(|selected| selected.tx.txid())
{
self.create_rbf_modal = None;
}
}
} }
Message::View(view::Message::CreateRbf(view::CreateRbfMessage::Cancel)) => { Message::View(view::Message::CreateRbf(view::CreateRbfMessage::Cancel)) => {
self.create_rbf_modal = None; self.create_rbf_modal = None;