From 2bae69fa0db43c6b4f5c50ef0e4a84ba4cf83d4f Mon Sep 17 00:00:00 2001 From: baraganio Date: Thu, 28 Mar 2024 17:10:15 +0100 Subject: [PATCH] Arreglando fallo bucle infinito en peticiones --- webapp/src/components/Game.js | 5 ++--- webapp/src/components/MainPage.js | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index 005d7ade..61933dd8 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -25,10 +25,10 @@ const Game = () => { useEffect(() => { handleShowQuestion(); - }); - + }, []); useEffect(() => { + console.log("eyou"); const intervalId = setInterval(() => { setSeconds(prevSeconds => prevSeconds - 1); }, 1000); @@ -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); diff --git a/webapp/src/components/MainPage.js b/webapp/src/components/MainPage.js index 17f1dffe..99e34b01 100644 --- a/webapp/src/components/MainPage.js +++ b/webapp/src/components/MainPage.js @@ -25,12 +25,6 @@ const MainPage = () => { Puedes comenzar la partida o ver tu historial. - - {/* - Your account was created on {createdAt}. - */} - - {/* Se declaran los botones en los q al hacer click se ejecuta el metodo especificado en onClick*/}