Skip to content

Commit 906f9e7

Browse files
committed
Corregido error a la hora de lanzar confeti
1 parent 17a5cb9 commit 906f9e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/context/QuizContextProvider.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ export const QuizContextProvider = ({ children }) => {
3434
};
3535

3636
const handleNext = () => {
37-
currentQuestion < shuffleQuestions.length - 1
38-
? setCurrentQuestion(currentQuestion + 1)
39-
: setCompleted(true),
37+
if (currentQuestion < shuffleQuestions.length - 1) {
38+
setCurrentQuestion(currentQuestion + 1);
39+
} else {
40+
setCompleted(true);
4041
confetti({
4142
particleCount: 150,
4243
spread: 360,
4344
origin: { y: 0.3, x: 0.5 },
4445
});
46+
}
4547

4648
setSelectedOption(null);
4749
};

0 commit comments

Comments
 (0)