diff --git a/client/src/components/game/GamePage.tsx b/client/src/components/game/GamePage.tsx index a5fe3b9..4f887d4 100644 --- a/client/src/components/game/GamePage.tsx +++ b/client/src/components/game/GamePage.tsx @@ -314,7 +314,12 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { {lobby.black?.name || "(no one)"} - black + + black + {lobby.black?.connected === false && ( + disconnected + )} + ); const whiteHtml = ( @@ -322,7 +327,12 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) { {lobby.white?.name || "(no one)"} - white + + white + {lobby.white?.connected === false && ( + disconnected + )} + ); diff --git a/server/src/controllers/games.controller.ts b/server/src/controllers/games.controller.ts index 281b1e6..7ba6f02 100644 --- a/server/src/controllers/games.controller.ts +++ b/server/src/controllers/games.controller.ts @@ -40,7 +40,10 @@ export const createGame = async (req: Request, res: Response) => { res.status(401).end(); return; } - const user: User = req.session.user; + const user: User = { + ...req.session.user, + connected: false + }; const unlisted: boolean = req.body.unlisted ?? false; const game: Game = { code: nanoid(6),