aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-10-10 14:14:42 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-10-10 14:14:42 +0200
commit490b813f77b3806343bbdd453d5abd29db9ea037 (patch)
tree95855651b678302cf3cf62aad480b783ca0419bf /packages/taler-wallet-core/src
parentb5f5001249122ff611f16c043e72ccb174990654 (diff)
parentadda4f8ce38ce030f55855bc0d66443d08153480 (diff)
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index cf2006406..72c67b153 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -1291,10 +1291,12 @@ export async function getTransactions(
const txNotPending = transactions.filter((x) => !isPending(x));
const txCmp = (h1: Transaction, h2: Transaction) => {
- const tsCmp = AbsoluteTime.cmp(
+ // Order transactions by timestamp. Newest transactions come first.
+ const tsCmp = -AbsoluteTime.cmp(
AbsoluteTime.fromPreciseTimestamp(h1.timestamp),
AbsoluteTime.fromPreciseTimestamp(h2.timestamp),
);
+ // If the timestamp is exactly the same, order by transaction type.
if (tsCmp === 0) {
return Math.sign(txOrder[h1.type] - txOrder[h2.type]);
}