aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app')
-rw-r--r--frontend/app/.server/api/schema.d.ts5
-rw-r--r--frontend/app/routes/dashboard.tsx3
-rw-r--r--frontend/app/routes/golf.$gameId.watch.tsx5
3 files changed, 12 insertions, 1 deletions
diff --git a/frontend/app/.server/api/schema.d.ts b/frontend/app/.server/api/schema.d.ts
index 88067a8..62badcf 100644
--- a/frontend/app/.server/api/schema.d.ts
+++ b/frontend/app/.server/api/schema.d.ts
@@ -96,6 +96,11 @@ export interface components {
/** @example 1 */
game_id: number;
/**
+ * @example 1v1
+ * @enum {string}
+ */
+ game_type: "1v1" | "multiplayer";
+ /**
* @example closed
* @enum {string}
*/
diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx
index e23d7aa..e6a43de 100644
--- a/frontend/app/routes/dashboard.tsx
+++ b/frontend/app/routes/dashboard.tsx
@@ -42,7 +42,8 @@ export default function Dashboard() {
<ul className="list-disc list-inside">
{games.map((game) => (
<li key={game.game_id}>
- {game.display_name}{" "}
+ {game.display_name}
+ {game.game_type === "multiplayer" ? " (Multiplayer)" : " (1v1)"}
{game.state === "closed" || game.state === "finished" ? (
<span className="inline-block px-6 py-2 text-gray-400 bg-gray-200 cursor-not-allowed rounded">
Entry
diff --git a/frontend/app/routes/golf.$gameId.watch.tsx b/frontend/app/routes/golf.$gameId.watch.tsx
index 83b7a1a..5edf92f 100644
--- a/frontend/app/routes/golf.$gameId.watch.tsx
+++ b/frontend/app/routes/golf.$gameId.watch.tsx
@@ -25,6 +25,11 @@ export async function loader({ params, request }: LoaderFunctionArgs) {
};
const [game, sockToken] = await Promise.all([fetchGame(), fetchSockToken()]);
+
+ if (game.game_type !== "1v1") {
+ return new Response("Not Found", { status: 404 });
+ }
+
return {
game,
sockToken,