Skip to content

Commit 6a374b0

Browse files
committed
Fix compatibility questions
1 parent a0a876a commit 6a374b0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

web/components/answers/add-compatibility-question-button.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function AddCompatibilityQuestionModal(props: {
5757
)
5858
const afterAddQuestion = (newQuestion: rowFor<'love_questions'>) => {
5959
setDbQuestion(newQuestion)
60+
console.log('setDbQuestion', newQuestion)
6061
}
6162

6263
return (
@@ -72,12 +73,12 @@ function AddCompatibilityQuestionModal(props: {
7273
compatibilityQuestion={dbQuestion as QuestionWithCountType}
7374
user={user}
7475
onSubmit={() => {
75-
setOpen(false)
76+
// setOpen(false)
7677
setDbQuestion(null)
7778
}}
7879
isLastQuestion
7980
onNext={() => {
80-
setOpen(false)
81+
// setOpen(false)
8182
setDbQuestion(null)
8283
}}
8384
/>
@@ -134,14 +135,12 @@ function CreateCompatibilityModalContent(props: {
134135
question: question,
135136
options: generateJson(),
136137
})
137-
if (
138-
newQuestion &&
139-
newQuestion.status == 'success' &&
140-
newQuestion.question
141-
) {
142-
afterAddQuestion(newQuestion.question as rowFor<'love_questions'>)
138+
console.log('create-compatibility-question', newQuestion)
139+
const q = newQuestion?.question
140+
if (q) {
141+
afterAddQuestion(q as rowFor<'love_questions'>)
143142
}
144-
track('create love compatibilty question')
143+
track('create love compatibility question')
145144
} catch (e) {
146145
toast.error('Error creating compatibility question. Try again?')
147146
}

0 commit comments

Comments
 (0)