summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/ShowAccountDetails.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/pages/ShowAccountDetails.tsx')
-rw-r--r--packages/demobank-ui/src/pages/ShowAccountDetails.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/ShowAccountDetails.tsx b/packages/demobank-ui/src/pages/ShowAccountDetails.tsx
index b109441a6..eb8ea8f20 100644
--- a/packages/demobank-ui/src/pages/ShowAccountDetails.tsx
+++ b/packages/demobank-ui/src/pages/ShowAccountDetails.tsx
@@ -1,5 +1,5 @@
import { TalerCorebankApi, TalerError, TranslatedString } from "@gnu-taler/taler-util";
-import { notify, notifyInfo, useTranslationContext } from "@gnu-taler/web-util/browser";
+import { notifyInfo, useLocalNotification, useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, VNode, h } from "preact";
import { useState } from "preact/hooks";
import { ErrorLoading } from "../components/ErrorLoading.js";
@@ -8,10 +8,11 @@ import { useBankCoreApiContext } from "../context/config.js";
import { useAccountDetails } from "../hooks/access.js";
import { useBackendState } from "../hooks/backend.js";
import { undefinedIfEmpty, withRuntimeErrorHandling } from "../utils.js";
-import { assertUnreachable } from "./WithdrawalOperationPage.js";
import { LoginForm } from "./LoginForm.js";
-import { AccountForm } from "./admin/AccountForm.js";
import { ProfileNavigation } from "./ProfileNavigation.js";
+import { assertUnreachable } from "./WithdrawalOperationPage.js";
+import { AccountForm } from "./admin/AccountForm.js";
+import { ShowLocalNotification } from "../components/ShowLocalNotification.js";
export function ShowAccountDetails({
account,
@@ -31,6 +32,7 @@ export function ShowAccountDetails({
const [update, setUpdate] = useState(false);
const [submitAccount, setSubmitAccount] = useState<TalerCorebankApi.AccountData | undefined>();
+ const [notification, notify, handleError] = useLocalNotification()
const result = useAccountDetails(account);
if (!result) {
@@ -50,7 +52,7 @@ export function ShowAccountDetails({
async function doUpdate() {
if (!update || !submitAccount || !creds) return;
- await withRuntimeErrorHandling(i18n, async () => {
+ await handleError(async () => {
const resp = await api.updateAccount(creds, {
cashout_address: submitAccount.cashout_payto_uri,
challenge_contact_data: undefinedIfEmpty({
@@ -93,6 +95,7 @@ export function ShowAccountDetails({
return (
<Fragment>
+ <ShowLocalNotification notification={notification} />
{accountIsTheCurrentUser ?
<ProfileNavigation current="details" />
: