Skip to content

Commit

Permalink
Fix bug when winning
Browse files Browse the repository at this point in the history
  • Loading branch information
zkkv committed Jul 8, 2024
1 parent 81e5e54 commit dc8b8ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function Game() {

const areAllAnswered = questions.every(q => q.selectedAnswerIndex !== null)
const nCorrect = questions.filter(q => q.selectedAnswerIndex === q.correctAnswerIndex).length
const hasWon = nCorrect === questions.length && nCorrect > 0
const hasWon = nCorrect === questions.length && nCorrect > 0 && gameState === "finished"
const containerRef = useRef(null)


Expand Down

0 comments on commit dc8b8ce

Please sign in to comment.