diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index bd2b0884..abfd1a60 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -52,7 +52,7 @@ const Game = () => { console.log(error.message); setError(error.response.data.error); } - }, []) + }, [usernameGlobal]) useEffect(() => { getQuestion(); @@ -76,7 +76,7 @@ const Game = () => { return () => { clearTimeout(timerId); } - }, [elapsedTime, getQuestion]); + }, [elapsedTime, getQuestion, answeredQuestions, navigate]); const handleOptionClick = async (option) => { setSelectedOption(option); @@ -86,7 +86,7 @@ const Game = () => { try { const timePassed = MAX_TIME - elapsedTime; - const response = await axios.get(`${apiEndpoint}/updateQuestion`, { + await axios.get(`${apiEndpoint}/updateQuestion`, { params: { question_Id: questionId, time: timePassed @@ -128,7 +128,7 @@ const Game = () => { {question}
- {image != null && image != "" && Imagen de la pregunta} + {image !== null && image !== "" && Imagen de la pregunta}
{options.map((option, index) => ( diff --git a/webapp/src/components/PantallaInicio.js b/webapp/src/components/PantallaInicio.js index a3fe0805..80f5bfb6 100644 --- a/webapp/src/components/PantallaInicio.js +++ b/webapp/src/components/PantallaInicio.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { Container, Typography, Button, Box, Snackbar } from '@mui/material'; import { useUser } from './UserContext'; import { useNavigate } from 'react-router-dom'; @@ -21,6 +21,7 @@ const PantallaInicio = () => { const logoutUser = async () => { try { setLoginSuccess(false); + console.log(loginSuccess); setUsernameGlobal(''); navigate('/App');