aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-11-27 14:29:51 -0300
committerSebastian <sebasjm@gmail.com>2023-11-27 14:30:03 -0300
commitfbcaff9f7663ce6e4d7c586003138a88b36ecdeb (patch)
treeb5f34559f4032e1a6770c8abb408e8a830c25c24 /packages/demobank-ui
parent9ebe77e228debacdda9e351b6b49ede85c8a03b7 (diff)
downloadwallet-core-fbcaff9f7663ce6e4d7c586003138a88b36ecdeb.tar.xz
default backend is location without webui
Diffstat (limited to 'packages/demobank-ui')
-rw-r--r--packages/demobank-ui/src/settings.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/settings.ts b/packages/demobank-ui/src/settings.ts
index 67f926e7f..b7d285519 100644
--- a/packages/demobank-ui/src/settings.ts
+++ b/packages/demobank-ui/src/settings.ts
@@ -46,7 +46,7 @@ export interface BankUiSettings {
* Global settings for the bank UI.
*/
const defaultSettings: BankUiSettings = {
- backendBaseURL: undefined,
+ backendBaseURL: buildDefaultBackendBaseURL(),
iconLinkURL: undefined,
bankName: "Taler Bank",
simplePasswordForRandomAccounts: false,
@@ -79,3 +79,11 @@ export function fetchSettings(listener: (s: BankUiSettings) => void): void {
}
+
+function buildDefaultBackendBaseURL(): string | undefined {
+ if (typeof window !== "undefined") {
+ const currentLocation = new URL(window.location.pathname, window.location.origin).href
+ return currentLocation.replace("/webui", "")
+ }
+ return undefined
+}