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/cta/TransferCreate/state.ts | |
| parent | 8d8d71807df6b775e5b0335eb1b2526a56d42ac6 (diff) | |
wxApi from context and using the new testing sdk
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts')
| -rw-r--r-- | packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts index c5e143f42..3536014da 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts @@ -17,19 +17,19 @@ import { Amounts, TalerErrorDetail, - TalerProtocolTimestamp, + TalerProtocolTimestamp } from "@gnu-taler/taler-util"; import { TalerError, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { format, isFuture, parse } from "date-fns"; +import { isFuture, parse } from "date-fns"; import { 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( { amount: amountStr, onClose, onSuccess }: Props, - api: typeof wxApi, ): State { + const api = useBackendContext() const amount = Amounts.parseOrThrow(amountStr); const [subject, setSubject] = useState<string | undefined>(); @@ -124,8 +124,8 @@ export function useComponentState( subject === undefined ? undefined : !subject - ? "Can't be empty" - : undefined, + ? "Can't be empty" + : undefined, value: subject ?? "", onInput: async (e) => setSubject(e), }, |
