Skip to content

Commit

Permalink
Arreglando fallo bucle infinito en peticiones
Browse files Browse the repository at this point in the history
  • Loading branch information
baraganio committed Mar 28, 2024
1 parent 56ea4b4 commit 2bae69f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 2 additions & 3 deletions webapp/src/components/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const Game = () => {

useEffect(() => {
handleShowQuestion();
});

}, []);

useEffect(() => {
console.log("eyou");
const intervalId = setInterval(() => {
setSeconds(prevSeconds => prevSeconds - 1);
}, 1000);
Expand Down Expand Up @@ -61,7 +61,6 @@ const Game = () => {

// Method that checks if the answer clicked is the correct one
const handleAnswerClick = (option, index) => {
// Get what component is the button to change its color later
if(option === correctOption) {
const buttonId = `button_${index}`;
const correctButton = document.getElementById(buttonId);
Expand Down
6 changes: 0 additions & 6 deletions webapp/src/components/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ const MainPage = () => {
Puedes comenzar la partida o ver tu historial.
</Typography>


{/* <Typography component="p" variant="body1" sx={{ textAlign: 'center', marginTop: 2 }}>
Your account was created on {createdAt}.
</Typography> */}

{/* Se declaran los botones en los q al hacer click se ejecuta el metodo especificado en onClick*/}
<Button variant="contained" color="primary" onClick={handleShowGame}>
Empezar juego
</Button>
Expand Down

0 comments on commit 2bae69f

Please sign in to comment.