From 55fddea5a2bc63589cd60eb2b3a479bf80a8c4ce Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 1 Feb 2024 12:47:38 +0100 Subject: [PATCH] Sort uncleared transactions to the top Signed-off-by: Knut Ahlers --- frontend/components/accountOverview.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/components/accountOverview.vue b/frontend/components/accountOverview.vue index 38f74c3..dd6ddaf 100644 --- a/frontend/components/accountOverview.vue +++ b/frontend/components/accountOverview.vue @@ -398,7 +398,15 @@ export default { sortedTransactions() { 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 },