From c4ef7f8568c6e7cc1c44c042ef48935b3d894e58 Mon Sep 17 00:00:00 2001 From: CANCI0 Date: Mon, 29 Apr 2024 12:34:41 +0200 Subject: [PATCH] =?UTF-8?q?Error=20al=20guardar=20en=20bater=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/pages/Bateria/Bateria.js | 4 ++-- webapp/src/pages/Social/UserGroups.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webapp/src/pages/Bateria/Bateria.js b/webapp/src/pages/Bateria/Bateria.js index 83154e0f..880a0c22 100644 --- a/webapp/src/pages/Bateria/Bateria.js +++ b/webapp/src/pages/Bateria/Bateria.js @@ -27,7 +27,7 @@ const JuegoPreguntas = () => { const [incorrectAnswers, setIncorrectAnswers] = useState(0); const [averageTime, setAverageTime] = useState(0); - const questionsToSave = []; + const [questionsToSave, setQuestionsToSave] = useState([]); useEffect(() => { setProgressPercent(100); @@ -152,7 +152,7 @@ const JuegoPreguntas = () => { correcta: actualQuestion.correcta, respuesta: answer, }; - questionsToSave.push(pregunta); + setQuestionsToSave([...questionsToSave, pregunta]); if (questionIndex + 1 < questions.length) { setQuestionIndex(questionIndex + 1); diff --git a/webapp/src/pages/Social/UserGroups.js b/webapp/src/pages/Social/UserGroups.js index 8f7947ca..e3f5861d 100644 --- a/webapp/src/pages/Social/UserGroups.js +++ b/webapp/src/pages/Social/UserGroups.js @@ -10,7 +10,6 @@ import { Th, Td, Flex, - Box, } from "@chakra-ui/react"; import Nav from "../../components/Nav/Nav.js"; import Footer from "../../components/Footer/Footer.js";