Skip to content

Commit

Permalink
Ya no se repite la primera pregunta en clásico
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Mar 5, 2024
1 parent 2c36795 commit cf74f29
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 2 additions & 0 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
13 changes: 3 additions & 10 deletions webapp/src/pages/Clasico/Clasico.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@ 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);
setIsLoading(false);
});
}, []);

useEffect(() => {
if (preguntas && preguntas.length > 0) {
setPreguntaActual(preguntas[0]);
setIsLoading(false);
}
}, [preguntas]);

useEffect(() => {
if (tiempoRestante === 0) {
setPreguntaTerminada(true);
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions webapp/src/pages/Stats/Stats.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}

0 comments on commit cf74f29

Please sign in to comment.