Skip to content

Commit

Permalink
Eliminacion de warnings para el despliegue
Browse files Browse the repository at this point in the history
  • Loading branch information
UO289337 committed Mar 27, 2024
1 parent 3c0136a commit c5cc3ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions webapp/src/components/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Game = () => {
console.log(error.message);
setError(error.response.data.error);
}
}, [])
}, [usernameGlobal])

useEffect(() => {
getQuestion();
Expand All @@ -76,7 +76,7 @@ const Game = () => {
return () => {
clearTimeout(timerId);
}
}, [elapsedTime, getQuestion]);
}, [elapsedTime, getQuestion, answeredQuestions, navigate]);

const handleOptionClick = async (option) => {
setSelectedOption(option);
Expand All @@ -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
Expand Down Expand Up @@ -128,7 +128,7 @@ const Game = () => {
{question}
</Typography>
<div>
{image != null && image != "" && <img src={image} alt="Imagen de la pregunta" width="40%" height="auto"/>}
{image !== null && image !== "" && <img src={image} alt="Imagen de la pregunta" width="40%" height="auto"/>}
</div>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '10px', alignItems: 'center', marginTop: '20px' }}>
{options.map((option, index) => (
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/components/PantallaInicio.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -21,6 +21,7 @@ const PantallaInicio = () => {
const logoutUser = async () => {
try {
setLoginSuccess(false);
console.log(loginSuccess);
setUsernameGlobal('');
navigate('/App');

Expand Down

0 comments on commit c5cc3ad

Please sign in to comment.