gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: wallet-core: order transactio


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: order transactions by descending timestamp
Date: Tue, 10 Oct 2023 12:14:08 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new adda4f8ce wallet-core: order transactions by descending timestamp
adda4f8ce is described below

commit adda4f8ce38ce030f55855bc0d66443d08153480
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Oct 10 12:14:09 2023 +0200

    wallet-core: order transactions by descending timestamp
---
 packages/taler-wallet-core/src/operations/transactions.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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]);
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]