aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/Routing.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-13 15:23:31 -0300
committerSebastian <sebasjm@gmail.com>2024-06-13 15:23:40 -0300
commit4f7eac1af8704d11fb3f58650558f932791f3d8e (patch)
tree08b029e79a44d454a8eff40d38dd2439f3051dba /packages/merchant-backoffice-ui/src/Routing.tsx
parent70926f609c766d47235a1fc47f189482bc9052bd (diff)
downloadwallet-core-4f7eac1af8704d11fb3f58650558f932791f3d8e.tar.xz
fix checking bank account with revenue api
Diffstat (limited to 'packages/merchant-backoffice-ui/src/Routing.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/Routing.tsx105
1 files changed, 18 insertions, 87 deletions
diff --git a/packages/merchant-backoffice-ui/src/Routing.tsx b/packages/merchant-backoffice-ui/src/Routing.tsx
index 4ffad2d6d..c290cd67f 100644
--- a/packages/merchant-backoffice-ui/src/Routing.tsx
+++ b/packages/merchant-backoffice-ui/src/Routing.tsx
@@ -146,7 +146,6 @@ export const publicPages = {
const history = createHashHistory();
export function Routing(_p: Props): VNode {
- // const { i18n } = useTranslationContext();
const { state } = useSessionContext();
type GlobalNotifState =
@@ -174,77 +173,6 @@ export function Routing(_p: Props): VNode {
const shouldLogin = state.status === "loggedOut";
- // function ServerErrorRedirectTo(to: InstancePaths | AdminPaths) {
- // return function ServerErrorRedirectToImpl(
- // error: HttpError<TalerErrorDetail>,
- // ) {
- // if (error.type === ErrorType.TIMEOUT) {
- // setGlobalNotification({
- // message: i18n.str`The request to the backend take too long and was cancelled`,
- // description: i18n.str`Diagnostic from ${error.info.url} is "${error.message}"`,
- // type: "ERROR",
- // to,
- // });
- // } else {
- // setGlobalNotification({
- // message: i18n.str`The backend reported a problem: HTTP status #${error.status}`,
- // description: i18n.str`Diagnostic from ${error.info.url} is '${error.message}'`,
- // details:
- // error.type === ErrorType.CLIENT || error.type === ErrorType.SERVER
- // ? error.payload.hint
- // : undefined,
- // type: "ERROR",
- // to,
- // });
- // }
- // return <Redirect to={to} />;
- // };
- // }
-
- // const LoginPageAccessDeniend = onUnauthorized
- // const LoginPageAccessDenied = () => {
- // return (
- // <Fragment>
- // <NotificationCard
- // notification={{
- // message: i18n.str`Access denied`,
- // description: i18n.str`Session expired or password changed.`,
- // type: "ERROR",
- // }}
- // />
- // <LoginPage />
- // </Fragment>
- // );
- // };
-
- // function IfAdminCreateDefaultOr<T>(Next: FunctionComponent<unknown>) {
- // return function IfAdminCreateDefaultOrImpl(props?: T) {
- // if (state.isAdmin && state.instance === DEFAULT_ADMIN_USERNAME) {
- // return (
- // <Fragment>
- // <NotificationCard
- // notification={{
- // message: i18n.str`No 'default' instance configured yet.`,
- // description: i18n.str`Create a 'default' instance to begin using the merchant backoffice.`,
- // type: "INFO",
- // }}
- // />
- // <InstanceCreatePage
- // forceId={DEFAULT_ADMIN_USERNAME}
- // onConfirm={() => {
- // route(InstancePaths.bank_list);
- // }}
- // />
- // </Fragment>
- // );
- // }
- // if (props) {
- // return <Next {...props} />;
- // }
- // return <Next />;
- // };
- // }
-
if (shouldLogin) {
return (
<Fragment>
@@ -274,21 +202,24 @@ export function Routing(_p: Props): VNode {
<KycBanner />
<NotificationCard notification={globalNotification} />
{error && (
- <NotificationCard
- notification={{
- message: "Internal error, please repot",
- type: "ERROR",
- description: (
- <pre>
- {
- (error instanceof Error
- ? error.stack
- : String(error)) as TranslatedString
- }
- </pre>
- ),
- }}
- />
+ <Fragment>
+ <NotificationCard
+ notification={{
+ message: "Internal error, please report",
+ type: "ERROR",
+
+ description: (
+ <pre>
+ {
+ (error instanceof Error
+ ? error.stack
+ : String(error)) as TranslatedString
+ }
+ </pre>
+ ),
+ }}
+ />
+ </Fragment>
)}
<Router