From b82a5e28f224abaefd27b16fafc83e8656832abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Schr=C3=B6tler?= <niklas@allround.digital> Date: Mon, 11 Dec 2023 19:48:15 +0100 Subject: [PATCH] Removed improvised subpath-handling --- package.json | 3 +-- public/config/default.json | 2 +- src/config.ts | 1 - src/services/LayoutService.ts | 5 ++--- 4 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/config.ts diff --git a/package.json b/package.json index 00adc78..47cee39 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,5 @@ }, "devDependencies": { "tailwindcss": "^3.3.2" - }, - "homepage": "https://niklasschroetler.fspages.org/infoscreen" + } } diff --git a/public/config/default.json b/public/config/default.json index 7dbd113..c9858c7 100644 --- a/public/config/default.json +++ b/public/config/default.json @@ -37,7 +37,7 @@ "h": 5 }, "config": { - "url": "/infoscreen/content/warning.png", + "url": "/content/warning.png", "title": "Achtung, Testbetrieb", "description": "Wie du vielleicht siehst, sieht dieser Bildschirm heute anders aus. Darf ich vorstellen: Der neue Infoscreen. Bitte beachte allerdings, dass wir gerade einen Testbetrieb machen. Bitte melde daher Fehler und auch sonstige Wünsche an Niklas unter @niklasschroetler:chat.upi.li oder niklas.schroetler@tu-dortmund.de" } diff --git a/src/config.ts b/src/config.ts deleted file mode 100644 index 79a3ff3..0000000 --- a/src/config.ts +++ /dev/null @@ -1 +0,0 @@ -export const BASE_URL = "/infoscreen"; // No trailing slash diff --git a/src/services/LayoutService.ts b/src/services/LayoutService.ts index 070cfcc..2b90cad 100644 --- a/src/services/LayoutService.ts +++ b/src/services/LayoutService.ts @@ -1,5 +1,4 @@ import {LayoutConfig} from "../types/LayoutConfig"; -import {BASE_URL} from "../config"; const NO_LAYOUT_CONFIG: LayoutConfig = { id: "", @@ -14,9 +13,9 @@ export class LayoutService { static async init(): Promise<void> { try { - const activeConfigs = await fetch(BASE_URL + "/activeConfigs.json").then(content => content.json()); + const activeConfigs = await fetch("/activeConfigs.json").then(content => content.json()); const configFetches = (activeConfigs as string[]) - .map(configPath => fetch(BASE_URL + "/" + configPath).then(content => content.json())); + .map(configPath => fetch(configPath).then(content => content.json())); LayoutService.configs = await Promise.all(configFetches); } catch (e) { -- GitLab