diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index 2cf86eb5..02484a8a 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react'; import { Container, Typography, Box, LinearProgress} from '@mui/material'; import './FirstGame.css'; import 'react-circular-progressbar/dist/styles.css'; -import axios from 'axios'; import { useLocation, useNavigate } from 'react-router-dom'; import Button from './Button'; import { Footer } from './footer/Footer'; @@ -12,7 +11,6 @@ import { gameStore } from './Util'; let currentQuestionIndex = 0; let haveFailedQuestion = false; -const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000'; let isCorrect = false let questions = []; let points = 0; diff --git a/webapp/src/components/Util.js b/webapp/src/components/Util.js index 6fd3d9a6..4b18bb9b 100644 --- a/webapp/src/components/Util.js +++ b/webapp/src/components/Util.js @@ -42,7 +42,7 @@ async function gameStore(id, username, points, questions, avgtime) { try { const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000'; - const response = await axios.post(`${apiEndpoint}/storeGame`, { id, username, points, questions, avgtime}); + await axios.post(`${apiEndpoint}/storeGame`, { id, username, points, questions, avgtime}); questions = [] } catch (error) { console.error(error) diff --git a/webapp/src/components/game/Calculator.js b/webapp/src/components/game/Calculator.js index 26aec1b9..249a40d0 100644 --- a/webapp/src/components/game/Calculator.js +++ b/webapp/src/components/game/Calculator.js @@ -6,17 +6,13 @@ import { Nav } from '../nav/Nav'; import Button from '../Button'; import { useState, useEffect} from 'react'; import { useNavigate } from 'react-router-dom'; -import axios from 'axios'; let questions = []; let load = true; const previousBackgroundColor = '#1a1a1a'; let points = 0; -const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000'; let answeredQuestions = []; -let savedGame = false; - const Calculator = () => {