Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into sergio
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287627 committed May 2, 2024
2 parents 7490301 + f2c382b commit 41b494c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const fs = require("fs")
const YAML = require('yaml')

const app = express();
app.disable("x-powered-by");
const port = 8000;

const authServiceUrl = process.env.AUTH_SERVICE_URL || 'http://localhost:8002';
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/components/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ const Game = ({ username, totalQuestions, timeLimit, themes }) => {

// Después de 3 segundos, restablecer la selección y pasar a la siguiente pregunta
setTimeout(async() => {
setNumberClics(numberClics + 1);
await obtenerPreguntaAleatoria();
setSelectedOption(null);
await addGeneratedQuestionBody();
setNumberClics(numberClics + 1);
setSelectedAnswer('');
}, delayBeforeNextQuestion);
}
Expand Down Expand Up @@ -177,14 +177,14 @@ const Game = ({ username, totalQuestions, timeLimit, themes }) => {
}
};

if ((timer >= timeLimit || numberClics === totalQuestions - 1)&& !almacenado) {
if ((timer >= timeLimit || finished)&& !almacenado) {
(async () => {
await addRecord();
await updateRanking();
})();
setAlmacenado(true);
}
}, [timer, numberClics, totalQuestions, timeLimit, almacenado, apiEndpoint, correctQuestions, username, setError]);
}, [timer, finished, totalQuestions, timeLimit, almacenado, apiEndpoint, correctQuestions, username, setError, themes, setThemesSelected ]);

if(isNaN(totalQuestions)){
totalQuestions=10;
Expand All @@ -195,7 +195,7 @@ const Game = ({ username, totalQuestions, timeLimit, themes }) => {

return (
<Container maxWidth="lg">
{numberClics >= totalQuestions || timer >= timeLimit ? (
{(numberClics >= totalQuestions || timer >= timeLimit) && almacenado? (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<Typography sx={{ mt: 4, mb: 2 }} variant="h6" component="div">
¡Gracias por jugar!
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/components/GameSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ const GameSettings = ({ setSettings, currentUser }) => {
return;
}
setIsWarningSecsVisible(false);
if (newValue === 60 ) {
if(totalMins === 10) {
return;
}
if(totalMins === 20) {
return;
}
if (newValue === 60 ) {
setTotalSecs(0);
setTotalMins((totalMins) => totalMins + 1);
}else {
Expand Down

0 comments on commit 41b494c

Please sign in to comment.