aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/components/modal/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/modal/index.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/components/modal/index.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/modal/index.tsx b/packages/merchant-backoffice-ui/src/components/modal/index.tsx
index 8372c84cc..1335d0f77 100644
--- a/packages/merchant-backoffice-ui/src/components/modal/index.tsx
+++ b/packages/merchant-backoffice-ui/src/components/modal/index.tsx
@@ -1,6 +1,6 @@
/*
This file is part of GNU Taler
- (C) 2021-2023 Taler Systems S.A.
+ (C) 2021-2024 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -22,11 +22,11 @@
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { ComponentChildren, Fragment, h, VNode } from "preact";
import { useState } from "preact/hooks";
-import { useInstanceContext } from "../../context/instance.js";
import { DEFAULT_REQUEST_TIMEOUT } from "../../utils/constants.js";
import { Spinner } from "../exception/loading.js";
import { FormProvider } from "../form/FormProvider.js";
import { Input } from "../form/Input.js";
+import { useSessionContext } from "../../context/session.js";
interface Props {
active?: boolean;
@@ -298,8 +298,8 @@ export function UpdateTokenModal({
new_token: !form.new_token
? i18n.str`cannot be empty`
: form.new_token === form.old_token
- ? i18n.str`cannot be the same as the old token`
- : undefined,
+ ? i18n.str`cannot be the same as the old token`
+ : undefined,
repeat_token:
form.new_token !== form.repeat_token
? i18n.str`is not the same`
@@ -310,9 +310,9 @@ export function UpdateTokenModal({
(k) => (errors as any)[k] !== undefined,
);
- const instance = useInstanceContext();
+ const { state } = useSessionContext();
- const text = i18n.str`You are updating the access token from instance with id ${instance.id}`;
+ const text = i18n.str`You are updating the access token from instance with id ${state.instance}`;
return (
<ClearConfirmModal
@@ -374,8 +374,8 @@ export function SetTokenNewInstanceModal({
new_token: !form.new_token
? i18n.str`cannot be empty`
: form.new_token === form.old_token
- ? i18n.str`cannot be the same as the old access token`
- : undefined,
+ ? i18n.str`cannot be the same as the old access token`
+ : undefined,
repeat_token:
form.new_token !== form.repeat_token
? i18n.str`is not the same`