diff options
author | Sebastian <sebasjm@gmail.com> | 2023-02-23 12:31:52 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-02-23 12:32:11 -0300 |
commit | f7c97f73bb0a3fca48e2e1c65950c3b73dd265c0 (patch) | |
tree | 90fce7f4a6f916bb4d260f7e4255eb84da2f5ee8 /packages/taler-wallet-webextension/src/components | |
parent | 3cdee428dd91b7d76e18034c3043f37a72b66b40 (diff) | |
download | wallet-core-f7c97f73bb0a3fca48e2e1c65950c3b73dd265c0.tar.xz |
fix: check amount request when no enough balance
Diffstat (limited to 'packages/taler-wallet-webextension/src/components')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/PaymentButtons.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx b/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx index f8983b995..67aaccf53 100644 --- a/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx +++ b/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx @@ -203,19 +203,19 @@ type NoEnoughBalanceReason = function getReason( info: PayMerchantInsufficientBalanceDetails, ): NoEnoughBalanceReason { - if (Amounts.cmp(info.amountRequested, info.balanceAvailable)) { + if (Amounts.cmp(info.amountRequested, info.balanceAvailable) > 0) { return "available"; } - if (Amounts.cmp(info.amountRequested, info.balanceMaterial)) { + if (Amounts.cmp(info.amountRequested, info.balanceMaterial) > 0) { return "material"; } - if (Amounts.cmp(info.amountRequested, info.balanceAgeAcceptable)) { + if (Amounts.cmp(info.amountRequested, info.balanceAgeAcceptable) > 0) { return "age-acceptable"; } - if (Amounts.cmp(info.amountRequested, info.balanceMerchantAcceptable)) { + if (Amounts.cmp(info.amountRequested, info.balanceMerchantAcceptable) > 0) { return "merchant-acceptable"; } - if (Amounts.cmp(info.amountRequested, info.balanceMerchantDepositable)) { + if (Amounts.cmp(info.amountRequested, info.balanceMerchantDepositable) > 0) { return "merchant-depositable"; } return "fee-gap"; |