Skip to content

Commit 4dd6f54

Browse files
committed
Add compat questions if none answered
1 parent a4e0203 commit 4dd6f54

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

web/components/answers/compatibility-questions-display.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ export function CompatibilityQuestionsDisplay(props: {
8383
}) {
8484
const {isCurrentUser, user, fromSignup, fromProfilePage, profile} = props
8585

86-
const {refreshCompatibilityQuestions, compatibilityQuestions} =
87-
useCompatibilityQuestionsWithAnswerCount()
86+
const {refreshCompatibilityQuestions, compatibilityQuestions} = useCompatibilityQuestionsWithAnswerCount()
8887

89-
const {refreshCompatibilityAnswers, compatibilityAnswers} =
90-
useUserCompatibilityAnswers(user.id)
88+
const {refreshCompatibilityAnswers, compatibilityAnswers} = useUserCompatibilityAnswers(user.id)
9189

9290
const [skippedAnswers, answers] = partition(
9391
compatibilityAnswers,
@@ -102,8 +100,7 @@ export function CompatibilityQuestionsDisplay(props: {
102100
skippedAnswers.map((answer) => answer.question_id)
103101
)
104102

105-
const {skippedQuestions, answeredQuestions, otherQuestions} =
106-
separateQuestionsArray(
103+
const {skippedQuestions, answeredQuestions, otherQuestions} = separateQuestionsArray(
107104
compatibilityQuestions,
108105
skippedAnswerQuestionIds,
109106
answeredQuestionIds
@@ -168,6 +165,8 @@ export function CompatibilityQuestionsDisplay(props: {
168165
currentSlice + NUM_QUESTIONS_TO_SHOW
169166
)
170167

168+
if (!isCurrentUser && !answeredQuestions.length) return null
169+
171170
return (
172171
<Col className="gap-4">
173172
<Row className="flex-wrap items-center justify-between gap-x-6 gap-y-4">

0 commit comments

Comments
 (0)