HASH 0b83deaa0dad
DATE 2025-08-04
SUBJECT web: fix json path resolution
FILES 1 CHANGED
HASH 0b83deaa0dad
DATE 2025-08-04
SUBJECT web: fix json path resolution
FILES 1 CHANGED
┌─ web/src/pages/challenge-mode.astro ───────────────────────────────────────┐
│ diff --git a/web/src/pages/challenge-mode.astro b/web/src/pages/challenge-mode.ast │
│ ro │
│ index 7534050..4286746 100644 │
│ --- a/web/src/pages/challenge-mode.astro │
│ +++ b/web/src/pages/challenge-mode.astro │
│ @@ -4,6 +4,8 @@ import ControlPanel from "../components/ControlPanel.astro"; │
│ import FormSelect from "../components/FormSelect.astro"; │
│ import LoadingState from "../components/LoadingState.astro"; │
│ import WoWClassColors from "../components/WoWClassColors.astro"; │
│ + │
│ +const baseUrl = import.meta.env.BASE_URL; │
│ --- │
│ │
│ <PageLayout │
│ @@ -374,7 +376,7 @@ import WoWClassColors from "../components/WoWClassColors.astro │
│ "; │
│ } │
│ </style> │
│ │
│ -<script is:inline> │
│ +<script is:inline define:vars={{ baseUrl }}> │
│ const DATA_MAP = { │
│ us: { │
│ name: "US", │
│ @@ -647,8 +649,9 @@ import WoWClassColors from "../components/WoWClassColors.astro │
│ "; │
│ try { │
│ const fileName = getDataFileName(); │
│ console.log("Loading file:", fileName); │
│ - console.log("Full fetch URL:", `${window.location.origin}/data/challenge-mo │
│ de/${fileName}`); │
│ - const response = await fetch(`/data/challenge-mode/${fileName}`); │
│ + const fullUrl = `${baseUrl}data/challenge-mode/${fileName}`.replace('//', ' │
│ /'); │
│ + console.log("Full fetch URL:", fullUrl); │
│ + const response = await fetch(fullUrl); │
│ │
│ if (!response.ok) { │
│ throw new Error( │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...rc/pages/challenge-mode.astro ───┐
│ diff --git a/web/src/pages/challenge-mode.as │
│ tro b/web/src/pages/challenge-mode.astro │
│ index 7534050..4286746 100644 │
│ --- a/web/src/pages/challenge-mode.astro │
│ +++ b/web/src/pages/challenge-mode.astro │
│ @@ -4,6 +4,8 @@ import ControlPanel from ".. │
│ /components/ControlPanel.astro"; │
│ import FormSelect from "../components/FormS │
│ elect.astro"; │
│ import LoadingState from "../components/Loa │
│ dingState.astro"; │
│ import WoWClassColors from "../components/W │
│ oWClassColors.astro"; │
│ + │
│ +const baseUrl = import.meta.env.BASE_URL; │
│ --- │
│ │
│ <PageLayout │
│ @@ -374,7 +376,7 @@ import WoWClassColors fr │
│ om "../components/WoWClassColors.astro"; │
│ } │
│ </style> │
│ │
│ -<script is:inline> │
│ +<script is:inline define:vars={{ baseUrl }} │
│ > │
│ const DATA_MAP = { │
│ us: { │
│ name: "US", │
│ @@ -647,8 +649,9 @@ import WoWClassColors fr │
│ om "../components/WoWClassColors.astro"; │
│ try { │
│ const fileName = getDataFileName(); │
│ console.log("Loading file:", fileName │
│ ); │
│ - console.log("Full fetch URL:", `${win │
│ dow.location.origin}/data/challenge-mode/${f │
│ ileName}`); │
│ - const response = await fetch(`/data/c │
│ hallenge-mode/${fileName}`); │
│ + const fullUrl = `${baseUrl}data/chall │
│ enge-mode/${fileName}`.replace('//', '/'); │
│ + console.log("Full fetch URL:", fullUr │
│ l); │
│ + const response = await fetch(fullUrl) │
│ ; │
│ │
│ if (!response.ok) { │
│ throw new Error( │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET