Skip to content

Commit

Permalink
fix: correctly filter next round generations for prompt screen
Browse files Browse the repository at this point in the history
  • Loading branch information
agrattan0820 committed Sep 12, 2023
1 parent 582fd4f commit 5163a93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/client/src/components/game/prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ const Prompt = ({

const gameId = gameInfo.game.id;
const userId = session.user.id;
const userGameRoundGenerations = gameInfo.gameRoundGenerations.filter(
(generation) => generation.user.id === userId,
);

const currRound = state.context.round;
const maxRegenerations = 3;

const userGameRoundGenerations = gameInfo.gameRoundGenerations.filter(
(generation) =>
generation.user.id === userId && generation.question.round === currRound,
);

const isSecondStage =
userGameRoundGenerations.length > 1 &&
userGameRoundGenerations.some(
Expand Down

0 comments on commit 5163a93

Please sign in to comment.