diff options
author | Sebastian <sebasjm@gmail.com> | 2022-04-25 22:37:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-04-26 11:48:28 -0300 |
commit | 65e6a8caa0de98632ad99cca35bf98bffe663dff (patch) | |
tree | 53bd9ec1c376e9cb73c57ba4ce223899c0b0751e /packages/taler-wallet-webextension/src/wallet/DepositPage.tsx | |
parent | 1e6b2dd150416d4acfac4cf4068c41edb036d5e0 (diff) | |
download | wallet-core-65e6a8caa0de98632ad99cca35bf98bffe663dff.tar.xz |
useAsync new API
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/DepositPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DepositPage.tsx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx index 98328ae4a..2bbd9f2e9 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx @@ -32,7 +32,7 @@ import { WarningBox, } from "../components/styled/index.js"; import { useTranslationContext } from "../context/translation.js"; -import { HookError, useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; +import { HookError, useAsyncAsHook2 } from "../hooks/useAsyncAsHook.js"; import { ButtonHandler, SelectFieldHandler, @@ -98,7 +98,7 @@ export function useComponentState( onSuccess: (currency: string) => void, api: typeof wxApi, ): State { - const hook = useAsyncAsHook(async () => { + const hook = useAsyncAsHook2(async () => { const { balances } = await api.getBalance(); const { accounts } = await api.listKnownBankAccounts(currency); const defaultSelectedAccount = @@ -117,10 +117,6 @@ export function useComponentState( const [fee, setFee] = useState<DepositGroupFees | undefined>(undefined); - // const hookResponse = !hook || hook.hasError ? undefined : hook.response; - - // useEffect(() => {}, [hookResponse]); - if (!hook || hook.hasError) { return { status: "loading", |