Fix post-game analysis state, add profile nav route, and fix mobile profile overflow

This commit is contained in:
tyuXX 2026-11-22 20:10:16 +03:00
parent 02b8bafb1e
commit 3ccab53b41
7 changed files with 158 additions and 23 deletions

View file

@ -578,17 +578,21 @@ export function createHttpHandler(deps: {
if (gameId && !segments[2] && method === 'GET') {
const active = gameManager.getGameState(gameId);
if (active) {
if (active && !active.finished) {
sendJson(res, 200, { kind: 'active', game: active });
return;
}
const stored = db.getGameById(gameId);
if (!stored) {
sendJson(res, 404, { error: 'Game not found.' });
if (stored) {
const analysis = db.getAnalysis(gameId);
sendJson(res, 200, { kind: 'stored', game: stored, analysis });
return;
}
const analysis = db.getAnalysis(gameId);
sendJson(res, 200, { kind: 'stored', game: stored, analysis });
if (active) {
sendJson(res, 200, { kind: 'active', game: active });
return;
}
sendJson(res, 404, { error: 'Game not found.' });
return;
}
}