summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-04-11 15:11:44 -0300
committerSebastian <sebasjm@gmail.com>2022-04-11 15:11:44 -0300
commitc3c0f3bfbb700f617c4fdfa0926c4ce5289c4449 (patch)
tree3bad9f708a466116e89a194ed99bfd8fb3b2c5df /packages/taler-wallet-webextension/src/cta
parenta644efe1abe8072bc92efa6d0fefde7504563086 (diff)
downloadwallet-core-c3c0f3bfbb700f617c4fdfa0926c4ce5289c4449.tar.gz
wallet-core-c3c0f3bfbb700f617c4fdfa0926c4ce5289c4449.tar.bz2
wallet-core-c3c0f3bfbb700f617c4fdfa0926c4ce5289c4449.zip
using alarm service intead of timeout api when the wallet is running in a service worker environment
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw.tsx14
1 files changed, 13 insertions, 1 deletions
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 <Loading />;
}
- console.log(state);
if (state.status === "loading-uri") {
if (!state.hook) return <Loading />;