gui: sort events and txs after push in the list

when a pending tx is confirmed, it is pushed in the
HistoryTransaction list at the end. It should be first
in the list. We sort now the list in order to make sure
it will be always the case.
This commit is contained in:
edouardparis 2024-03-20 13:01:36 +01:00
parent dd29578c50
commit ff7e30794b
2 changed files with 2 additions and 0 deletions

View File

@ -180,6 +180,7 @@ impl State for Home {
self.events.push(event);
}
}
self.events.sort_by(|a, b| b.time.cmp(&a.time));
}
},
Message::PendingTransactions(res) => match res {

View File

@ -100,6 +100,7 @@ impl State for TransactionsPanel {
self.txs.push(tx);
}
}
self.txs.sort_by(|a, b| b.time.cmp(&a.time));
}
},
Message::PendingTransactions(res) => match res {