diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Payment/index.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Payment/index.ts | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/index.ts b/packages/taler-wallet-webextension/src/cta/Payment/index.ts index 6e401f7d2..b20f91b0c 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Payment/index.ts @@ -14,7 +14,14 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { AmountJson, ConfirmPayResult, PreparePayResult, PreparePayResultAlreadyConfirmed, PreparePayResultInsufficientBalance, PreparePayResultPaymentPossible } from "@gnu-taler/taler-util"; +import { + AmountJson, + ConfirmPayResult, + PreparePayResult, + PreparePayResultAlreadyConfirmed, + PreparePayResultInsufficientBalance, + PreparePayResultPaymentPossible, +} from "@gnu-taler/taler-util"; import { TalerError } from "@gnu-taler/taler-wallet-core"; import { Loading } from "../../components/Loading.js"; import { HookError } from "../../hooks/useAsyncAsHook.js"; @@ -24,8 +31,6 @@ import * as wxApi from "../../wxApi.js"; import { useComponentState } from "./state.js"; import { LoadingUriView, BaseView } from "./views.js"; - - export interface Props { talerPayUri?: string; goToWalletManualWithdraw: (amount?: string) => Promise<void>; @@ -42,7 +47,6 @@ export type State = | State.Confirmed; export namespace State { - export interface Loading { status: "loading"; error: undefined; @@ -60,12 +64,12 @@ export namespace State { cancel: () => Promise<void>; } export interface NoBalanceForCurrency extends BaseInfo { - status: "no-balance-for-currency" + status: "no-balance-for-currency"; payStatus: PreparePayResult; balance: undefined; } export interface NoEnoughBalance extends BaseInfo { - status: "no-enough-balance" + status: "no-enough-balance"; payStatus: PreparePayResult; balance: AmountJson; } @@ -101,4 +105,8 @@ const viewMapping: StateViewMap<State> = { ready: BaseView, }; -export const PaymentPage = compose("Payment", (p: Props) => useComponentState(p, wxApi), viewMapping) +export const PaymentPage = compose( + "Payment", + (p: Props) => useComponentState(p, wxApi), + viewMapping, +); |