This commit is contained in:
Dmitry 2026-01-07 17:19:47 +03:00
parent 5983bc5bed
commit 313dde163e

View file

@ -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