From cf74f293362b1543768a6a46051459f2355f155e Mon Sep 17 00:00:00 2001 From: CANCI0 Date: Tue, 5 Mar 2024 16:07:31 +0100 Subject: [PATCH] =?UTF-8?q?Ya=20no=20se=20repite=20la=20primera=20pregunta?= =?UTF-8?q?=20en=20cl=C3=A1sico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gatewayservice/gateway-service.js | 2 ++ webapp/src/App.js | 2 +- webapp/src/pages/Clasico/Clasico.js | 13 +++---------- webapp/src/pages/Stats/Stats.css | 6 ------ 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index e5fbe175..ba124555 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -18,6 +18,8 @@ app.use(express.json()); const metricsMiddleware = promBundle({includeMethod: true}); app.use(metricsMiddleware); +app.set("json spaces", 40); + // Health check endpoint app.get('/health', (req, res) => { res.json({ status: 'OK' }); diff --git a/webapp/src/App.js b/webapp/src/App.js index b879f817..e654bb13 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -6,7 +6,7 @@ import Bateria from './pages/Bateria/Bateria.js'; import WrongRoute from './pages/WrongRoute/WrongRoute.js'; import Stats from './pages/Stats/Stats.js'; import './App.css'; -import {BrowserRouter, Routes, Route, Navigate} from "react-router-dom"; +import {BrowserRouter, Routes, Route} from "react-router-dom"; function App() { return ( diff --git a/webapp/src/pages/Clasico/Clasico.js b/webapp/src/pages/Clasico/Clasico.js index 290d6d78..6bd7fb15 100644 --- a/webapp/src/pages/Clasico/Clasico.js +++ b/webapp/src/pages/Clasico/Clasico.js @@ -30,7 +30,8 @@ const JuegoPreguntas = () => { .then((response) => response.json()) .then((data) => { setPreguntas(data); - //setIsLoading(false); + setPreguntaActual(data[0]); + setIsLoading(false); }) .catch((error) => { console.error('Error al obtener las preguntas:', error); @@ -38,13 +39,6 @@ const JuegoPreguntas = () => { }); }, []); - useEffect(() => { - if (preguntas && preguntas.length > 0) { - setPreguntaActual(preguntas[0]); - setIsLoading(false); - } - }, [preguntas]); - useEffect(() => { if (tiempoRestante === 0) { setPreguntaTerminada(true); @@ -96,12 +90,11 @@ const JuegoPreguntas = () => { setTiempoTotal(tiempoTotal+10-tiempoRestante); - setRespuestaSeleccionada(null); setTiempoRestante(10); if (indicePregunta + 1 < preguntas.length) { setIndicePregunta(indicePregunta + 1); - setPreguntaActual(preguntas[indicePregunta]); + setPreguntaActual(preguntas[indicePregunta + 1]); } else { try { diff --git a/webapp/src/pages/Stats/Stats.css b/webapp/src/pages/Stats/Stats.css index 355af678..a2d1506e 100644 --- a/webapp/src/pages/Stats/Stats.css +++ b/webapp/src/pages/Stats/Stats.css @@ -24,10 +24,4 @@ input, button, a{ color: #6b456c; font-family: "Times New Roman", serif; -} - -body { - background-color: #ffffe5; - font-family: "Times New Roman", serif; - } \ No newline at end of file