Skip to content

Commit 3ec709e

Browse files
committed
question card hotfix
1 parent 07b2324 commit 3ec709e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/components/app/questions/layout/question-card.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ export default async function QuestionCard(opts: {
2222
identifier = 'slug',
2323
} = opts;
2424

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-
);
25+
// get question stats and user answered at the same time
26+
const [questionStats, userAnswered] = await Promise.all([
27+
getQuestionStats(identifier, questionData[identifier] || ''),
28+
getUserAnswer({ questionUid: questionData.uid }),
29+
]);
3330

3431
// if identifier is uid, this is a custom question
3532
const href =

0 commit comments

Comments
 (0)