From 204d54b1896e0a3eeaaa927d565b3bc3fcc1770c Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sun, 22 Dec 2024 10:47:36 +0000 Subject: [PATCH] fix wallet transactions ordering --- frontend/src/app/components/wallet/wallet.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/wallet/wallet.component.ts b/frontend/src/app/components/wallet/wallet.component.ts index bf5b67ae7..43cc7ee80 100644 --- a/frontend/src/app/components/wallet/wallet.component.ts +++ b/frontend/src/app/components/wallet/wallet.component.ts @@ -302,7 +302,7 @@ export class WalletComponent implements OnInit, OnDestroy { }), map(transactions => { // only confirmed transactions supported for now - return transactions.filter(tx => tx.status.confirmed); + return transactions.filter(tx => tx.status.confirmed).sort((a, b) => b.status.block_height - a.status.block_height); }), catchError((error) => { console.log(error); @@ -329,7 +329,7 @@ export class WalletComponent implements OnInit, OnDestroy { this.electrsApiService.getAddressesTransactions$(this.addressStrings, this.transactions[this.transactions.length - 1].txid) .subscribe((transactions: Transaction[]) => { if (transactions && transactions.length) { - this.transactions = this.transactions.concat(transactions); + this.transactions = this.transactions.concat(transactions.sort((a, b) => b.status.block_height - a.status.block_height)); } else { this.fullyLoaded = true; }