diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index a5bf771a..ffcb5e46 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -7,7 +7,6 @@ import { useLocation, useNavigate } from 'react-router-dom'; import Button from './Button'; import { Footer } from './footer/Footer'; import { Nav } from './nav/Nav'; -import {esperar} from './Util'; let currentQuestionIndex = 0; @@ -52,6 +51,10 @@ const Quiz = () => { clearInterval(time); }; }); + + const esperar = (ms) => { + return new Promise(resolve => setTimeout(resolve, ms)); + }; function changeButtons(param) { var borders = document.getElementsByClassName("border");; @@ -108,6 +111,7 @@ const Quiz = () => { haveFailedQuestion = false; load = true haveEnter = false + console.log("Calbo") if (currentQuestionIndex === allQuestions.length ) { console.log("Entramos aqui") diff --git a/webapp/src/components/game/GameConfiguration.js b/webapp/src/components/game/GameConfiguration.js index c51d84f4..5a2d88b8 100644 --- a/webapp/src/components/game/GameConfiguration.js +++ b/webapp/src/components/game/GameConfiguration.js @@ -13,10 +13,10 @@ import { generateGameId } from '../Util'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000'; let gameId; -let questions = [] -const GameConfiguration = () => { +const GameConfiguration = () => { + let questions = [] const navigation = useNavigate(); let tematicas = ['Paises', 'Capitales']; let state = useLocation().state;