diff --git a/src/context/QuizProvider.tsx b/src/context/QuizProvider.tsx index 28b3aac..5be6a62 100644 --- a/src/context/QuizProvider.tsx +++ b/src/context/QuizProvider.tsx @@ -33,7 +33,7 @@ const QuizProvider = ({ children }: QuizProviderProps) => { useEffect(() => { setTimer(totalTime) setQuestions(quizQuestions) - }, [quizTopic]) + }, [quizTopic, totalTime, quizQuestions]); const quizDetails = { totalQuestions, diff --git a/src/hooks/useTimer.ts b/src/hooks/useTimer.ts index 5dee3e1..ac22788 100644 --- a/src/hooks/useTimer.ts +++ b/src/hooks/useTimer.ts @@ -28,7 +28,7 @@ const useTimer = ( }, 1000) return () => clearTimeout(countTimer) } - }, [timer, setTimer]) + }, [timer, setTimer, showResultModal]) } export default useTimer