Skip to content

Commit

Permalink
issues
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288574 committed Apr 24, 2024
1 parent 2099fbb commit 0db60ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 36 deletions.
16 changes: 7 additions & 9 deletions webapp/src/components/AddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ const AddUser = () => {
const addUser = async () => {
if (name.trim() === '' || surname.trim() === '') {
setError('Por favor, introduzca tanto el nombre como los apellidos.');
} else if(password !== confirmPassword){
setError('Las contraseñas no coinciden.');
} else {
if(password !== confirmPassword){
setError('Las contraseñas no coinciden.');
}else{
try {
await axios.post(`${apiEndpoint}/adduser`, { username, password });
setOpenSnackbar(true);
} catch (error) {
setError(error.response.data.error);
}
try {
await axios.post(`${apiEndpoint}/adduser`, { username, password });
setOpenSnackbar(true);
} catch (error) {
setError(error.response.data.error);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import axios from 'axios';
//var isApiCalledRef = false;//ASK - is this necessary?
const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000';

var topics
let topics

const Menu = () => {

Expand Down
16 changes: 0 additions & 16 deletions webapp/src/components/game/GameConfiguration.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,6 @@
z-index: 100;
}

/*@keyframes click-wave {
0% {
height: 40px;
width: 40px;
opacity: 0.35;
position: relative;
}
100% {
height: 200px;
width: 200px;
margin-left: -80px;
margin-top: -80px;
opacity: 0;
}
}*/

#numPreguntas{
width: 2rem;
}
13 changes: 3 additions & 10 deletions webapp/src/components/game/GameConfiguration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { Container } from '@mui/material';
import { Footer } from '../footer/Footer';
import { Nav } from '../nav/Nav';
Expand All @@ -10,10 +10,9 @@ import './GameConfiguration.css';

const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000';

var gameId;
var questions = []
let gameId;
let questions = []
const previousBackgroundColor = '#1a1a1a'
// (configureNumErrors)

const GameConfiguration = () => {

Expand All @@ -33,8 +32,6 @@ const GameConfiguration = () => {
const [numPreguntas, setNumPreguntas] = useState(1);
// Almacen de mensaje de error para el spinner
const [error, setError] = useState(null);
// Almacen del número de errores
const [numeroErrores, setNumeroErrores] = useState("ninguno");


const handleTematicaChange = (event) => {
Expand All @@ -60,10 +57,6 @@ const GameConfiguration = () => {
}
};

const handleChange = (event) => {
setNumeroErrores(event.target.value);
};

const initiateGame = async () => {
console.log(tematicasSeleccionadas)
console.log(numPreguntas)
Expand Down

0 comments on commit 0db60ea

Please sign in to comment.