commit 23031fc5d2255fd314eb8c80756393c18d84e02f
parent e1319ca80f9da544ecea95b4e43cb7b054569649
Author: Sebastian <sebasjm@gmail.com>
Date: Thu, 20 Jun 2024 18:15:43 -0300
show login form on token error
Diffstat:
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
@@ -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
@@ -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
@@ -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
@@ -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) {