summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-28 12:53:00 +0100
committerFlorian Dold <florian@dold.me>2024-03-28 12:53:00 +0100
commit89ccb56dbb2a4f22588244dcbe81338b844cc3ea (patch)
treec96e853abdc40eaaa75be896f7c536d5040fb153 /packages
parent9da3ba8d9091478b093a961fb36b846c873c4516 (diff)
downloadwallet-core-89ccb56dbb2a4f22588244dcbe81338b844cc3ea.tar.gz
wallet-core-89ccb56dbb2a4f22588244dcbe81338b844cc3ea.tar.bz2
wallet-core-89ccb56dbb2a4f22588244dcbe81338b844cc3ea.zip
wallet-core: fix account sort order to match spec
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-wallet-core/src/withdraw.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
index 424f370ff..8767c1eca 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -3016,10 +3016,10 @@ async function fetchWithdrawalAccountInfo(
withdrawalAccounts.push(acctInfo);
}
withdrawalAccounts.sort((x1, x2) => {
- // Accounts without priority come last.
- const n1 = x1.priority ?? Number.MAX_SAFE_INTEGER;
- const n2 = x2.priority ?? Number.MAX_SAFE_INTEGER;
- return Math.sign(n1 - n2);
+ // Accounts without explicit priority have prio 0.
+ const n1 = x1.priority ?? 0;
+ const n2 = x2.priority ?? 0;
+ return Math.sign(n2 - n1);
});
return withdrawalAccounts;
}