Sort uncleared transactions to the top

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-02-01 12:47:38 +01:00
parent dae017f99e
commit 55fddea5a2
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -398,7 +398,15 @@ export default {
sortedTransactions() { sortedTransactions() {
const tx = [...this.transactions] const tx = [...this.transactions]
tx.sort((b, a) => new Date(a.time).getTime() - new Date(b.time).getTime()) tx.sort((b, a) => {
if (a.cleared && !b.cleared) {
return -1
} else if (!a.cleared && b.cleared) {
return 1
}
return new Date(a.time).getTime() - new Date(b.time).getTime()
})
return tx return tx
}, },