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