feat : add game panel info

This commit is contained in:
GuillaumeSD
2024-02-24 16:32:22 +01:00
parent 6156e4a228
commit 035591208f
17 changed files with 290 additions and 73 deletions

View File

@@ -105,10 +105,14 @@ export const useGameDatabase = (shouldFetchGames?: boolean) => {
const { gameId } = router.query;
useEffect(() => {
if (typeof gameId === "string") {
getGame(parseInt(gameId)).then((game) => {
setGameFromUrl(game);
});
switch (typeof gameId) {
case "string":
getGame(parseInt(gameId)).then((game) => {
setGameFromUrl(game);
});
break;
default:
setGameFromUrl(undefined);
}
}, [gameId, setGameFromUrl, getGame]);