src
This commit is contained in:
parent
5983bc5bed
commit
313dde163e
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue