[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/03: show login form on token error
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/03: show login form on token error |
Date: |
Thu, 20 Jun 2024 23:16:06 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
commit 23031fc5d2255fd314eb8c80756393c18d84e02f
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu Jun 20 18:15:43 2024 -0300
show login form on token error
---
packages/bank-ui/src/pages/AccountPage/index.ts | 7 ++++++-
packages/bank-ui/src/pages/WireTransfer.tsx | 7 ++++++-
packages/bank-ui/src/pages/account/ShowAccountDetails.tsx | 7 ++++++-
packages/bank-ui/src/pages/admin/RemoveAccount.tsx | 7 ++++++-
4 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/packages/bank-ui/src/pages/AccountPage/index.ts
b/packages/bank-ui/src/pages/AccountPage/index.ts
index 8a9471ef4..e96702652 100644
--- a/packages/bank-ui/src/pages/AccountPage/index.ts
+++ b/packages/bank-ui/src/pages/AccountPage/index.ts
@@ -26,6 +26,7 @@ import { LoginForm } from "../LoginForm.js";
import { useComponentState } from "./state.js";
import { InvalidIbanView, ReadyView } from "./views.js";
import { RouteDefinition } from "@gnu-taler/web-util/browser";
+import { Fragment } from "preact";
export interface Props {
account: string;
@@ -125,7 +126,11 @@ const viewMapping: utils.StateViewMap<State> = {
loading: Loading,
login: LoginForm,
"invalid-iban": InvalidIbanView,
- "loading-error": ErrorLoadingWithDebug,
+ "loading-error": (d) => {
+ return Fragment({
+ children: [ErrorLoadingWithDebug({ error: d.error }), LoginForm({})],
+ })!;
+ },
ready: ReadyView,
};
diff --git a/packages/bank-ui/src/pages/WireTransfer.tsx
b/packages/bank-ui/src/pages/WireTransfer.tsx
index f45390938..817145702 100644
--- a/packages/bank-ui/src/pages/WireTransfer.tsx
+++ b/packages/bank-ui/src/pages/WireTransfer.tsx
@@ -62,7 +62,12 @@ export function WireTransfer({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {
diff --git a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
index 7db81115f..f602c67df 100644
--- a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
+++ b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
@@ -91,7 +91,12 @@ export function ShowAccountDetails({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {
diff --git a/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
b/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
index dbeebf719..74e39112d 100644
--- a/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
+++ b/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
@@ -74,7 +74,12 @@ export function RemoveAccount({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.