From 9f8bddfe93d62eb59b4a0699ca5fcd29443f1443 Mon Sep 17 00:00:00 2001 From: eliasnijs Date: Tue, 5 Mar 2024 12:20:22 +0100 Subject: [PATCH] :ambulance: hotfix routing error --- solid-watchparty/config.js | 2 +- solid-watchparty/src/components/SWPageWrapper.jsx | 5 ++++- solid-watchparty/vite.config.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/solid-watchparty/config.js b/solid-watchparty/config.js index 1088bb9..5eb67cc 100644 --- a/solid-watchparty/config.js +++ b/solid-watchparty/config.js @@ -1,4 +1,4 @@ export default { - baseDir: '/solid-watch-party/', + baseDir: '/solid-watch-party', outDir: '../dist', } diff --git a/solid-watchparty/src/components/SWPageWrapper.jsx b/solid-watchparty/src/components/SWPageWrapper.jsx index 1c2af52..2d562df 100644 --- a/solid-watchparty/src/components/SWPageWrapper.jsx +++ b/solid-watchparty/src/components/SWPageWrapper.jsx @@ -12,6 +12,9 @@ import SWLoadingIcon from './SWLoadingIcon'; /* util imports */ import { inSession } from '../utils/solidUtils'; +/* config imports */ +import config from '../../config'; + /* NOTE(Elias): className has influence on how the component between the Navbar and footer is styled. */ function SWPageWrapper({children, className, mustBeAuthenticated}) @@ -22,7 +25,7 @@ function SWPageWrapper({children, className, mustBeAuthenticated}) useEffect(() => { if (mustBeAuthenticated && !sessionRequestInProgress && !inSession(session)) { - navigateTo('/', {state: {from: currentLocation.pathname + currentLocation.search}}); + navigateTo(`${config.baseDir}/`, {state: {from: currentLocation.pathname + currentLocation.search}}); } }, [session, sessionRequestInProgress, currentLocation, navigateTo, mustBeAuthenticated]) diff --git a/solid-watchparty/vite.config.js b/solid-watchparty/vite.config.js index 69c8d6d..5cd0f43 100644 --- a/solid-watchparty/vite.config.js +++ b/solid-watchparty/vite.config.js @@ -5,7 +5,7 @@ import config from './config.js' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], - base: config.baseDir, + base: `${config.baseDir}`, build: { outDir: config.outDir },