feat: link competition games to detail analysis

Route each result-history Game by its global display number and preserve the Competition return target. Refuse stale detail fallbacks so a missing requested Game cannot silently show another Game.
This commit is contained in:
dahyeon committed 2026-07-13 10:41:44 +00:00
1 parent 3c60081ece
commit 3bd3120eb1
11 files changed
+382 -54

No files matched your search

@@ -0,0 +1,14 @@
export function selectInternalMatchGame<T extends { gameNumber: number }>(
games: readonly T[],
requestedGameNumber: number,
): T | null {
if (
!Number.isSafeInteger(requestedGameNumber) ||
requestedGameNumber <= 0
) {
return null;
}
return (
games.find((game) => game.gameNumber === requestedGameNumber) ?? null
);
}