diff options
author | Florian Dold <florian@dold.me> | 2022-03-29 13:47:32 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-29 13:48:51 +0200 |
commit | c265e7d019d445add2d2cfb7cfcbdeee059684d3 (patch) | |
tree | 6904e9cdb723992728ed511103be65094ca50034 /packages/taler-wallet-webextension | |
parent | be489b6b3ea4214f546dfc33d6bb0f39ce82b5ab (diff) |
wallet: make retries more robust and consistent
Diffstat (limited to 'packages/taler-wallet-webextension')
3 files changed, 9 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.stories.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.stories.tsx index ddd0926be..cadd0c86d 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.stories.tsx @@ -20,7 +20,7 @@ */ import { Balance, parsePaytoUri } from "@gnu-taler/taler-util"; -import { DepositFee } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; +import type { DepositGroupFees } from "@gnu-taler/taler-wallet-core/src/operations/deposits.js"; import { createExample } from "../test-utils.js"; import { View as TestedComponent } from "./DepositPage.js"; @@ -30,7 +30,7 @@ export default { argTypes: {}, }; -async function alwaysReturnFeeToOne(): Promise<DepositFee> { +async function alwaysReturnFeeToOne(): Promise<DepositGroupFees> { const fee = { currency: "EUR", value: 1, diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx index 3874b65f5..1ad8b07f5 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx @@ -21,7 +21,7 @@ import { Balance, PaytoUri, } from "@gnu-taler/taler-util"; -import { DepositFee } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; +import { DepositGroupFees } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; import { Fragment, h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; import { Loading } from "../components/Loading.js"; @@ -68,7 +68,7 @@ export function DepositPage({ currency, onCancel, onSuccess }: Props): VNode { async function getFeeForAmount( p: PaytoUri, a: AmountJson, - ): Promise<DepositFee> { + ): Promise<DepositGroupFees> { const account = `payto://${p.targetType}/${p.targetPath}`; const amount = Amounts.stringify(a); return await wxApi.getFeeForDeposit(account, amount); @@ -106,7 +106,7 @@ interface ViewProps { onCalculateFee: ( account: PaytoUri, amount: AmountJson, - ) => Promise<DepositFee>; + ) => Promise<DepositGroupFees>; } type State = NoBalanceState | NoAccountsState | DepositState; @@ -135,12 +135,12 @@ export function useComponentState( onCalculateFee: ( account: PaytoUri, amount: AmountJson, - ) => Promise<DepositFee>, + ) => Promise<DepositGroupFees>, ): State { const accountMap = createLabelsForBankAccount(accounts); const [accountIdx, setAccountIdx] = useState(0); const [amount, setAmount] = useState<number | undefined>(undefined); - const [fee, setFee] = useState<DepositFee | undefined>(undefined); + const [fee, setFee] = useState<DepositGroupFees | undefined>(undefined); function updateAmount(num: number | undefined) { setAmount(num); setFee(undefined); diff --git a/packages/taler-wallet-webextension/src/wxApi.ts b/packages/taler-wallet-webextension/src/wxApi.ts index b2d484d4b..128a82fdd 100644 --- a/packages/taler-wallet-webextension/src/wxApi.ts +++ b/packages/taler-wallet-webextension/src/wxApi.ts @@ -59,7 +59,7 @@ import { RemoveBackupProviderRequest, TalerError, } from "@gnu-taler/taler-wallet-core"; -import type { DepositFee } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; +import type { DepositGroupFees } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; import type { ExchangeWithdrawDetails } from "@gnu-taler/taler-wallet-core/src/operations/withdraw"; import { platform, MessageFromBackend } from "./platform/api.js"; @@ -143,7 +143,7 @@ export function resetDb(): Promise<void> { export function getFeeForDeposit( depositPaytoUri: string, amount: AmountString, -): Promise<DepositFee> { +): Promise<DepositGroupFees> { return callBackend("getFeeForDeposit", { depositPaytoUri, amount, |