Skip to content

Commit

Permalink
Some warnings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
algarfer authored Mar 14, 2024
1 parent 1d6c5c2 commit 2dba5f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webapp/src/views/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Game() {
const [current, setCurrent] = useState(0);

// State to see correct answers
const [correctAnswers, setCorrectAnswers] = useState(0);
// const [correctAnswers, setCorrectAnswers] = useState(0);

// Linear time bar
const initialTime = 10; // seconds
Expand All @@ -30,10 +30,10 @@ export default function Game() {

const timerId = useRef();

const navigate = useNavigate();


// Next question
const next = useCallback(() => {
const navigate = useNavigate();

if (current === questions.length - 1) {
navigate("/menu");
Expand All @@ -42,7 +42,7 @@ export default function Game() {
setCurrent(current + 1);
setTimeLeft(initialTime);
setProgressBarPercent(0);
}, [current, questions.length, correctAnswers, initialTime]);
}, [current, questions.length, initialTime]);

// Timer
useEffect(() => {
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function Game() {
next();
}
}
}, [timeLeft, progressBarPercent, current, correctAnswers, next]);
}, [timeLeft, progressBarPercent, current, next]);


//Fetch questions just at the beginning
Expand Down

0 comments on commit 2dba5f5

Please sign in to comment.