Skip to content

Commit

Permalink
πŸ“ (app/exam/page.tsx): update initial currentQuestionIndex state to …
Browse files Browse the repository at this point in the history
…1 instead of 0 for better user experience

βœ… (app/exam/page.tsx): fix a bug where the initial question index was set to 0, causing an error on first render
  • Loading branch information
danieldanielecki committed Oct 2, 2024
1 parent a162e69 commit 4afdab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/exam/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Exam: NextPage<{ searchParams: { url: string; name: string } }> = ({
useTimer({ minutes: minutes, seconds: seconds });
const [currentQuestion, setCurrentQuestion] = useState<Question>();
const [revealExam, setRevealExam] = useState<boolean>(false);
const [currentQuestionIndex, setCurrentQuestionIndex] = useState<number>(0);
const [currentQuestionIndex, setCurrentQuestionIndex] = useState<number>(1);
const [countAnswered, setCountAnswered] = useState<number>(0);
const { data, loading, error } = useQuery(questionsQuery, {
variables: { range: 30, link: url },
Expand Down

0 comments on commit 4afdab3

Please sign in to comment.