Skip to content

Commit

Permalink
fix(game): get questions whenever trial or not
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Oct 20, 2023
1 parent 0da63cf commit 1a9e7d9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ export default async function Home() {
})

const user = await fetchUser()
const isTrial = user === null
const userScoreInCurrentTest = user
? await fetchUserScoreInCurrentTest({ userId: user.userId, testId })
: null

const images = userScoreInCurrentTest
? []
: await getQuestions({
length: user === null ? 1 : env.NEXT_PUBLIC_QUESTIONS_PER_CHALLENGE,
testId,
now,
})
const images = await getQuestions({
length: isTrial ? 1 : env.NEXT_PUBLIC_QUESTIONS_PER_CHALLENGE,
testId,
now,
})

return (
<Game
Expand Down

0 comments on commit 1a9e7d9

Please sign in to comment.