summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Refund/state.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-09 08:38:48 -0300
committerSebastian <sebasjm@gmail.com>2023-01-09 08:38:48 -0300
commit9b04d8bf3581d162cbd631892ca115df811c46f8 (patch)
tree42b7da7cc3a3f8186823a7571aa221dc8e9aa7a5 /packages/taler-wallet-webextension/src/cta/Refund/state.ts
parent14f3d1e06dda003d457f2b3531e197011a284244 (diff)
downloadwallet-core-9b04d8bf3581d162cbd631892ca115df811c46f8.tar.gz
wallet-core-9b04d8bf3581d162cbd631892ca115df811c46f8.tar.bz2
wallet-core-9b04d8bf3581d162cbd631892ca115df811c46f8.zip
fix #7152
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Refund/state.ts')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Refund/state.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Refund/state.ts b/packages/taler-wallet-webextension/src/cta/Refund/state.ts
index 9e3311b65..5a5073ba3 100644
--- a/packages/taler-wallet-webextension/src/cta/Refund/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/Refund/state.ts
@@ -17,7 +17,9 @@
import { Amounts, NotificationType } from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { useEffect, useState } from "preact/hooks";
+import { alertFromError } from "../../context/alert.js";
import { useBackendContext } from "../../context/backend.js";
+import { useTranslationContext } from "../../context/translation.js";
import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
import { Props, State } from "./index.js";
@@ -27,6 +29,7 @@ export function useComponentState({
onSuccess,
}: Props): State {
const api = useBackendContext();
+ const { i18n } = useTranslationContext();
const [ignored, setIgnored] = useState(false);
const info = useAsyncAsHook(async () => {
@@ -49,10 +52,19 @@ export function useComponentState({
}
if (info.hasError) {
return {
- status: "loading-uri",
- error: info,
+ status: "error",
+ error: alertFromError(
+ i18n.str`Could not load the status of the term of service`,
+ info,
+ ),
};
}
+ // if (info.hasError) {
+ // return {
+ // status: "loading-uri",
+ // error: info,
+ // };
+ // }
const { refund, uri } = info.response;