diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-16 14:29:35 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-16 14:29:35 -0300 |
commit | 6ddb2de84245ae3914c92b2b2eb7399e7f04500e (patch) | |
tree | 425cc377daf053e5283bee6986f6f437f25d7584 /packages/taler-wallet-webextension/src/cta/Payment/index.ts | |
parent | 860f10e6f004668d3109b5a1d96ddb2b26ddc2f5 (diff) | |
download | wallet-core-6ddb2de84245ae3914c92b2b2eb7399e7f04500e.tar.xz |
pretty
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, +); |