From c3c0f3bfbb700f617c4fdfa0926c4ce5289c4449 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Apr 2022 15:11:44 -0300 Subject: using alarm service intead of timeout api when the wallet is running in a service worker environment --- packages/taler-wallet-webextension/src/cta/Withdraw.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw.tsx') diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx index 9739e1a47..78e821576 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx @@ -99,6 +99,9 @@ export function useComponentState( undefined, ); + /** + * Ask the wallet about the withdraw URI + */ const uriInfoHook = useAsyncAsHook(async () => { if (!talerWithdrawUri) throw Error("ERROR_NO-URI-FOR-WITHDRAWAL"); @@ -110,6 +113,9 @@ export function useComponentState( return { uriInfo, knownExchanges }; }); + /** + * Get the amount and select one exchange + */ const exchangeAndAmount = useAsyncAsHook( async () => { if (!uriInfoHook || uriInfoHook.hasError || !uriInfoHook.response) return; @@ -136,6 +142,9 @@ export function useComponentState( [!uriInfoHook || uriInfoHook.hasError ? undefined : uriInfoHook], ); + /** + * For the exchange selected, bring the status of the terms of service + */ const terms = useAsyncAsHook( async () => { if ( @@ -159,6 +168,10 @@ export function useComponentState( ], ); + /** + * With the exchange and amount, ask the wallet the information + * about the withdrawal + */ const info = useAsyncAsHook( async () => { if ( @@ -466,7 +479,6 @@ export function WithdrawPage({ talerWithdrawUri }: Props): VNode { return ; } - console.log(state); if (state.status === "loading-uri") { if (!state.hook) return ; -- cgit v1.2.3