Use different msg for reloading or extending history tx list

After reorg last payments were not removed as the reloading
message was handle as an extension of the list.

close #1260
This commit is contained in:
edouardparis 2024-09-04 18:19:21 +02:00
parent e11529be56
commit 1d720d12a4
2 changed files with 9 additions and 1 deletions

View File

@ -39,6 +39,7 @@ pub enum Message {
Verified(Fingerprint, Result<(), Error>),
StartRescan(Result<(), Error>),
HardwareWallets(HardwareWalletMessage),
HistoryTransactionsExtension(Result<Vec<HistoryTransaction>, Error>),
HistoryTransactions(Result<Vec<HistoryTransaction>, Error>),
PendingTransactions(Result<Vec<HistoryTransaction>, Error>),
LabelsUpdated(Result<HashMap<String, Option<String>>, Error>),

View File

@ -180,6 +180,13 @@ impl State for Home {
}
},
Message::HistoryTransactions(res) => match res {
Err(e) => self.warning = Some(e),
Ok(events) => {
self.warning = None;
self.events = events;
}
},
Message::HistoryTransactionsExtension(res) => match res {
Err(e) => self.warning = Some(e),
Ok(events) => {
self.warning = None;
@ -259,7 +266,7 @@ impl State for Home {
}
Ok(events)
},
Message::HistoryTransactions,
Message::HistoryTransactionsExtension,
);
}
}