diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-15 17:11:24 -0300 |
commit | f93bd51499ed34844b666bf6d333227adf4368bf (patch) | |
tree | ed3cf0c38b7db54276436d1743a6085c94f71977 /packages/taler-wallet-webextension/src/wallet/Notifications | |
parent | 8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff) | |
download | wallet-core-f93bd51499ed34844b666bf6d333227adf4368bf.tar.xz |
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Notifications')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Notifications/index.ts | 5 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Notifications/state.ts | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Notifications/index.ts b/packages/taler-wallet-webextension/src/wallet/Notifications/index.ts index 253a0e629..3791b8967 100644 --- a/packages/taler-wallet-webextension/src/wallet/Notifications/index.ts +++ b/packages/taler-wallet-webextension/src/wallet/Notifications/index.ts @@ -18,11 +18,10 @@ import { UserAttentionUnreadList } from "@gnu-taler/taler-util"; import { Loading } from "../../components/Loading.js"; import { HookError } from "../../hooks/useAsyncAsHook.js"; import { compose, StateViewMap } from "../../utils/index.js"; -import { wxApi } from "../../wxApi.js"; import { useComponentState } from "./state.js"; import { LoadingUriView, ReadyView } from "./views.js"; -export interface Props {} +export type Props = object export type State = State.Loading | State.LoadingUriError | State.Ready; @@ -56,6 +55,6 @@ const viewMapping: StateViewMap<State> = { export const NotificationsPage = compose( "NotificationsPage", - (p: Props) => useComponentState(p, wxApi), + (p: Props) => useComponentState(p), viewMapping, ); diff --git a/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts b/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts index 093722cf0..1042dea9f 100644 --- a/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts @@ -15,11 +15,12 @@ */ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; +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({}: Props, api: typeof wxApi): State { +export function useComponentState(p: Props): State { + const api = useBackendContext() const hook = useAsyncAsHook(async () => { return await api.wallet.call( WalletApiOperation.GetUserAttentionRequests, |