From 52e9863a0df4814d947c6388e827f64b56a07160 Mon Sep 17 00:00:00 2001 From: Helene Lotsberg Date: Tue, 24 Nov 2026 14:13:12 +0100 Subject: [PATCH] add #/ to the address on the start page, like the other pages --- frontend/src/main.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 059304ee..88a9e49f 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -9,6 +9,14 @@ import { ApolloProvider } from "@apollo/client/react"; import { UserProvider } from "./context/UserContext"; import { GRAPHQL_URL } from "./graphql/apiUrl"; +// HashRouter only adds "#/" when the user navigates, so the start page would +// have the address /project2/ without it. Adding it at once gives every page +// the same kind of address, and anything typed after it goes to the app +// instead of to the server. +if (!window.location.hash) { + window.history.replaceState(null, "", "#/"); +} + const client = new ApolloClient({ link: new HttpLink({ uri: GRAPHQL_URL }), cache: new InMemoryCache({