Skip to content

Commit

Permalink
Merge pull request #240 from Arquisoft/front_end_angel
Browse files Browse the repository at this point in the history
sonarcloud fix
  • Loading branch information
sergiollende authored Apr 28, 2024
2 parents e492fe2 + d3a4b83 commit 8be14a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions webapp/src/components/Game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ export default function Game(props: Props) {
setQuestionCount(questionCount+1);
setLoading(true);

if(!isNaN(Number((questions[questionCount].answers[0]))))
questions[questionCount].answers = questions[questionCount].answers.map((a) => formatNumberWithDots(a));
if(!isNaN(Number((questions[questionCount].answers[0])))){
const newAnswers = questions[questionCount].answers.map((a) => formatNumberWithDots(a));
questions[questionCount].answers = newAnswers;
}

setTimeout(() => {
setLoading(false);
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/components/Game/Trivia/TriviaGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ const getSetColor: (n: number) => SetColorFunction = (n: number) => {

const saveAnswer = (answer: string) => {
answerSelected.push(answer);
setAnswerSelected(answerSelected);
const newAnswers = [...answerSelected];
setAnswerSelected(newAnswers);

setDiceResult(0);

questions.push(questionShowed as questionType);
setQuestions(questions);
const newQuestions = [...questions];
setQuestions(newQuestions);
}


Expand Down
3 changes: 1 addition & 2 deletions webapp/src/components/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const Login = (props:props) => {
return;
}

const response = login(username, password);
console.log(response);
const response = await login(username, password);
if (!response) {
setError("Invalid Credentials");
}
Expand Down

0 comments on commit 8be14a3

Please sign in to comment.