feat: add root and route-level error boundaries

This commit is contained in:
lila 2026-04-26 08:45:18 +02:00
parent e3d28e4127
commit 0da8397940
4 changed files with 109 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import type { GameSession, GameRequest, AnswerResult } from "@lila/shared";
import { QuestionCard } from "../components/game/QuestionCard";
import { ScoreScreen } from "../components/game/ScoreScreen";
import { GameSetup } from "../components/game/GameSetup";
import RouteError from "../components/RouteError";
import { authClient } from "../lib/auth-client";
type GameStartResponse = { success: true; data: GameSession };
@ -127,6 +128,7 @@ function Play() {
export const Route = createFileRoute("/play")({
component: Play,
errorComponent: RouteError,
beforeLoad: async () => {
const { data: session } = await authClient.getSession();
if (!session) {