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(() => { useEffect(() => {
setTimer(totalTime) setTimer(totalTime)
setQuestions(quizQuestions) setQuestions(quizQuestions)
}, [quizTopic])
}, [quizTopic, totalTime, quizQuestions]);
const quizDetails = { const quizDetails = {
totalQuestions, totalQuestions,

2
src/hooks/useTimer.ts

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