diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-17 16:01:04 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-17 16:01:28 -0300 |
commit | 420493b3e608f3b245ebae308a318883f9f605f7 (patch) | |
tree | 9d30255d66dcda7c7fabc190e3b372369a66540a /packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts | |
parent | 252382a9375ea05f62389e33f111c3fa008d8fff (diff) | |
download | wallet-core-420493b3e608f3b245ebae308a318883f9f605f7.tar.xz |
use payto builder and prevent showing cancel for non-payment
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts index d7d9f2da7..b744b80e5 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts @@ -60,8 +60,8 @@ export function useComponentState({ parsed !== undefined ? parsed : currency !== undefined - ? Amounts.zeroOfCurrency(currency) - : undefined; + ? Amounts.zeroOfCurrency(currency) + : undefined; // const [accountIdx, setAccountIdx] = useState<number>(0); const [selectedAccount, setSelectedAccount] = useState<PaytoUri>(); @@ -147,7 +147,7 @@ export function useComponentState({ initialValue ?? ({} as any), ); const amountStr = Amounts.stringify(amount); - const depositPaytoUri = `payto://${currentAccount.targetType}/${currentAccount.targetPath}`; + const depositPaytoUri = stringifyPaytoUri(currentAccount); // eslint-disable-next-line react-hooks/rules-of-hooks const hook = useAsyncAsHook(async () => { @@ -193,8 +193,8 @@ export function useComponentState({ const amountError = !isDirty ? undefined : Amounts.cmp(balance, amount) === -1 - ? `Too much, your current balance is ${Amounts.stringifyValue(balance)}` - : undefined; + ? `Too much, your current balance is ${Amounts.stringifyValue(balance)}` + : undefined; const unableToDeposit = Amounts.isZero(totalToDeposit) || //deposit may be zero because of fee |