We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07b2324 commit 3ec709eCopy full SHA for 3ec709e
src/components/app/questions/layout/question-card.tsx
@@ -22,14 +22,11 @@ export default async function QuestionCard(opts: {
22
identifier = 'slug',
23
} = opts;
24
25
- const questionStats = showSubmissions
26
- ? await getQuestionStats(identifier, questionData[identifier] || '')
27
- : null;
28
-
29
- // has the user answered this question?
30
- const userAnswered = Boolean(
31
- await getUserAnswer({ questionUid: questionData.uid })
32
- );
+ // get question stats and user answered at the same time
+ const [questionStats, userAnswered] = await Promise.all([
+ getQuestionStats(identifier, questionData[identifier] || ''),
+ getUserAnswer({ questionUid: questionData.uid }),
+ ]);
33
34
// if identifier is uid, this is a custom question
35
const href =
0 commit comments