aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/demobank-ui/src/hooks/backend.ts16
-rw-r--r--packages/demobank-ui/src/pages/AccountPage.tsx8
-rw-r--r--packages/demobank-ui/src/pages/QrCodeSection.tsx15
3 files changed, 17 insertions, 22 deletions
diff --git a/packages/demobank-ui/src/hooks/backend.ts b/packages/demobank-ui/src/hooks/backend.ts
index e0b8d83ef..ca73a4793 100644
--- a/packages/demobank-ui/src/hooks/backend.ts
+++ b/packages/demobank-ui/src/hooks/backend.ts
@@ -53,10 +53,18 @@ interface LoggedOut {
export function getInitialBackendBaseURL(): string {
const overrideUrl = localStorage.getItem("bank-base-url");
-
- return canonicalizeBaseUrl(
- overrideUrl ? overrideUrl : bankUiSettings.backendBaseURL,
- );
+ if (!overrideUrl) {
+ //normal path
+ if (!bankUiSettings.backendBaseURL) {
+ console.error(
+ "ERROR: backendBaseURL was overridden by a setting file and missing. Setting value to 'window.origin'",
+ );
+ return canonicalizeBaseUrl(window.origin);
+ }
+ return canonicalizeBaseUrl(bankUiSettings.backendBaseURL);
+ }
+ // testing/development path
+ return canonicalizeBaseUrl(overrideUrl);
}
export const defaultState: BackendState = {
diff --git a/packages/demobank-ui/src/pages/AccountPage.tsx b/packages/demobank-ui/src/pages/AccountPage.tsx
index bab8cca16..13960a8da 100644
--- a/packages/demobank-ui/src/pages/AccountPage.tsx
+++ b/packages/demobank-ui/src/pages/AccountPage.tsx
@@ -20,15 +20,13 @@ import {
HttpResponsePaginated,
useTranslationContext,
} from "@gnu-taler/web-util/lib/index.browser";
-import { Fragment, h, VNode } from "preact";
-import { Loading } from "../components/Loading.js";
+import { Fragment, VNode, h } from "preact";
import { Transactions } from "../components/Transactions/index.js";
-import { PageStateType, notifyError } from "../context/pageState.js";
+import { useBackendContext } from "../context/backend.js";
+import { notifyError } from "../context/pageState.js";
import { useAccountDetails } from "../hooks/access.js";
import { LoginForm } from "./LoginForm.js";
import { PaymentOptions } from "./PaymentOptions.js";
-import { StateUpdater } from "preact/hooks";
-import { useBackendContext } from "../context/backend.js";
interface Props {
account: string;
diff --git a/packages/demobank-ui/src/pages/QrCodeSection.tsx b/packages/demobank-ui/src/pages/QrCodeSection.tsx
index 8613bfca7..919f2b1fe 100644
--- a/packages/demobank-ui/src/pages/QrCodeSection.tsx
+++ b/packages/demobank-ui/src/pages/QrCodeSection.tsx
@@ -48,20 +48,9 @@ export function QrCodeSection({
<p>
<i18n.Translate>
Click{" "}
- <a
- id="linkqr"
- href={talerWithdrawUri}
- >{i18n.str`this taler:// link`}</a>{" "}
- to open your Taler wallet
+ <a href={talerWithdrawUri}>{i18n.str`this taler:// link`}</a> to
+ open your Taler wallet
</i18n.Translate>{" "}
- <i18n.Translate>
- or try{" "}
- <a
- id="linkqr"
- href={"ext+" + talerWithdrawUri}
- >{i18n.str`this ext+taler:// link`}</a>{" "}
- if your browser does not support <b>taler://</b> scheme.
- </i18n.Translate>
</p>
<br />
<a