From 313dde163e1520c0dc1a9ef3342f14cf6a5c30a8 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 7 Jan 2026 17:19:47 +0300 Subject: [PATCH] src --- src/components/Game.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/Game.jsx b/src/components/Game.jsx index de193fc..1c24473 100644 --- a/src/components/Game.jsx +++ b/src/components/Game.jsx @@ -87,6 +87,13 @@ const Game = forwardRef(({ setCookie('gameOver', gameOver) }, [gameOver]) + // Устанавливаем первого игрока текущим, если есть игроки, но нет текущего игрока + useEffect(() => { + if (players.length > 0 && !currentPlayerId) { + setCurrentPlayerId(players[0].id) + } + }, [players, currentPlayerId]) + const currentQuestion = questions[currentQuestionIndex] const isLastQuestion = currentQuestionIndex === questions.length - 1