aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/InvoicePay
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-12-15 17:11:24 -0300
committerSebastian <sebasjm@gmail.com>2022-12-15 17:11:24 -0300
commitf93bd51499ed34844b666bf6d333227adf4368bf (patch)
treeed3cf0c38b7db54276436d1743a6085c94f71977 /packages/taler-wallet-webextension/src/cta/InvoicePay
parent8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff)
downloadwallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.xz
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoicePay')
-rw-r--r--packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts5
-rw-r--r--packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts4
2 files changed, 4 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts
index 6e16b528c..78f244964 100644
--- a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts
+++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts
@@ -18,13 +18,12 @@ import {
AbsoluteTime,
AmountJson,
PreparePayResult,
- TalerErrorDetail,
+ TalerErrorDetail
} from "@gnu-taler/taler-util";
import { Loading } from "../../components/Loading.js";
import { HookError } from "../../hooks/useAsyncAsHook.js";
import { ButtonHandler } from "../../mui/handlers.js";
import { compose, StateViewMap } from "../../utils/index.js";
-import { wxApi } from "../../wxApi.js";
import { useComponentState } from "./state.js";
import { LoadingUriView, ReadyView } from "./views.js";
@@ -92,6 +91,6 @@ const viewMapping: StateViewMap<State> = {
export const InvoicePayPage = compose(
"InvoicePayPage",
- (p: Props) => useComponentState(p, wxApi),
+ (p: Props) => useComponentState(p),
viewMapping,
);
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
index c7fb48958..eb50ba748 100644
--- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
@@ -25,14 +25,14 @@ import {
} from "@gnu-taler/taler-util";
import { TalerError, WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { useEffect, useState } from "preact/hooks";
+import { useBackendContext } from "../../context/backend.js";
import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
-import { wxApi } from "../../wxApi.js";
import { Props, State } from "./index.js";
export function useComponentState(
{ talerPayPullUri, onClose, goToWalletManualWithdraw, onSuccess }: Props,
- api: typeof wxApi,
): State {
+ const api = useBackendContext()
const hook = useAsyncAsHook(async () => {
const p2p = await api.wallet.call(WalletApiOperation.CheckPeerPullPayment, {
talerUri: talerPayPullUri,