fix wallet transactions ordering
This commit is contained in:
parent
c248544fe8
commit
204d54b189
@ -302,7 +302,7 @@ export class WalletComponent implements OnInit, OnDestroy {
|
|||||||
}),
|
}),
|
||||||
map(transactions => {
|
map(transactions => {
|
||||||
// only confirmed transactions supported for now
|
// 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) => {
|
catchError((error) => {
|
||||||
console.log(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)
|
this.electrsApiService.getAddressesTransactions$(this.addressStrings, this.transactions[this.transactions.length - 1].txid)
|
||||||
.subscribe((transactions: Transaction[]) => {
|
.subscribe((transactions: Transaction[]) => {
|
||||||
if (transactions && transactions.length) {
|
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 {
|
} else {
|
||||||
this.fullyLoaded = true;
|
this.fullyLoaded = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user