Skip to content

Commit

Permalink
sort schedule previews by date, then amount (#4452)
Browse files Browse the repository at this point in the history
* sort schedule previews by date, then amount

* note
  • Loading branch information
matt-fidd authored Feb 25, 2025
1 parent f413fa0 commit eface19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/loot-core/src/client/data-hooks/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ export function usePreviewTransactions(): UsePreviewTransactionsResult {
})
.flat()
.sort(
(a, b) => parseDate(b.date).getTime() - parseDate(a.date).getTime(),
(a, b) =>
parseDate(b.date).getTime() - parseDate(a.date).getTime() ||
a.amount - b.amount,
);
}, [isSchedulesLoading, schedules, statuses, upcomingLength]);

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4452.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [matt-fidd]
---

Sort upcoming schedules by date then amount so deposits come before payments

0 comments on commit eface19

Please sign in to comment.