summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DepositPage.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/DepositPage.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx
index 9e15daa97..abe830e87 100644
--- a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx
@@ -110,7 +110,6 @@ export function View({
setAmount(num);
setFee(undefined);
}
- const feeHasBeenCalculated = fee !== undefined;
const currency = balance.currency;
const amountStr: AmountString = `${currency}:${amount}`;
const feeSum =
@@ -151,7 +150,7 @@ export function View({
: !parsedAmount
? "Invalid amount"
: Amounts.cmp(balance, parsedAmount) === -1
- ? `To much, your current balance is ${Amounts.stringifyValue(balance)}`
+ ? `Too much, your current balance is ${Amounts.stringifyValue(balance)}`
: undefined;
const totalToDeposit = parsedAmount
@@ -159,7 +158,7 @@ export function View({
: Amounts.getZero(currency);
const unableToDeposit =
- Amounts.isZero(totalToDeposit) && feeHasBeenCalculated;
+ Amounts.isZero(totalToDeposit) || fee === undefined || error !== undefined;
return (
<Fragment>
@@ -224,12 +223,13 @@ export function View({
</section>
<footer>
<div />
- <ButtonPrimary
- disabled={unableToDeposit}
- onClick={() => onSend(accountURI, amountStr)}
- >
- Deposit {Amounts.stringifyValue(totalToDeposit)} {currency}
- </ButtonPrimary>
+ {unableToDeposit ? (
+ <ButtonPrimary disabled>Deposit</ButtonPrimary>
+ ) : (
+ <ButtonPrimary onClick={() => onSend(accountURI, amountStr)}>
+ Deposit {Amounts.stringifyValue(totalToDeposit)} {currency}
+ </ButtonPrimary>
+ )}
</footer>
</Fragment>
);