Browse Source

fix react bug

main
Jeffrey 4 months ago
parent
commit
23bc04e660
  1. 2
      src/context/QuizProvider.tsx
  2. 2
      src/hooks/useTimer.ts

2
src/context/QuizProvider.tsx

@ -33,7 +33,7 @@ const QuizProvider = ({ children }: QuizProviderProps) => {
useEffect(() => {
setTimer(totalTime)
setQuestions(quizQuestions)
}, [quizTopic])
}, [quizTopic, totalTime, quizQuestions]);
const quizDetails = {
totalQuestions,

2
src/hooks/useTimer.ts

@ -28,7 +28,7 @@ const useTimer = (
}, 1000)
return () => clearTimeout(countTimer)
}
}, [timer, setTimer])
}, [timer, setTimer, showResultModal])
}
export default useTimer
Loading…
Cancel
Save