From 43d894a0db89e35f9ce2d18ec8ab8a96c5773bb1 Mon Sep 17 00:00:00 2001 From: Josh Payette Date: Sat, 4 Jul 2026 20:02:23 -0400 Subject: [PATCH] Fixed home page not resetting gameId. --- src/routes/__root.tsx | 2 +- src/routes/index.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index c69bb65..65cd178 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -13,7 +13,7 @@ import { RootDocument } from "#/components/RootDocument.tsx"; import { OG_IMAGE, SERVER_GAME_INPUTS_QUERY_KEY } from "#/constants"; import { clientEnv } from "#/env/client-env.ts"; import { getServerResolvedGameInputsServerFn } from "#/features/game/active-game"; -import { getValidatedGameId } from "#/registry/game-public-registry.tsx";; +import { getValidatedGameId } from "#/registry/game-public-registry.tsx"; import type { GameId } from "@/prisma"; interface MyRouterContext { diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 163306c..4930413 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,8 +1,16 @@ import { Title } from "@mantine/core"; import { createFileRoute } from "@tanstack/react-router"; +import { useEffect } from "react"; +import { setGame } from "#/features/game/store.ts"; + +const HomePage = () => { + useEffect(() => setGame("none")); + + return Home Page; +}; const Route = createFileRoute("/")({ - component: () => Home Page, + component: HomePage, }); export { Route }; -- 2.51.2