Skip to content

Commit

Permalink
chore: due to the design of the backend, add petition to end the game
Browse files Browse the repository at this point in the history
  • Loading branch information
jjgancfer committed Apr 18, 2024
1 parent 7d036f7 commit aac5620
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/pages/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Center } from "@chakra-ui/layout";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import Confetti from "react-confetti";
import { startRound, getCurrentQuestion, answerQuestion, getCurrentGame } from '../components/game/Game';
import { startRound, getCurrentQuestion, answerQuestion, getCurrentGame, getGameDetails } from '../components/game/Game';
import LateralMenu from '../components/menu/LateralMenu';
import MenuButton from '../components/menu/MenuButton';
import { HttpStatusCode } from "axios";
Expand Down Expand Up @@ -92,6 +92,7 @@ export default function Game() {

const nextRound = useCallback(async () => {
if (roundNumber + 1 > maxRoundNumber) {
await getGameDetails(gameId);
navigate("/dashboard/game/results", { state: { correctAnswers: correctAnswers } });
} else {
setAnswer({});
Expand Down

0 comments on commit aac5620

Please sign in to comment.