diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 059304e..88a9e49 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({