feat: add root and route-level error boundaries
This commit is contained in:
parent
e3d28e4127
commit
0da8397940
4 changed files with 109 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue