Skip to content

Commit

Permalink
Fix survey logic test
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoonmi committed Nov 21, 2023
1 parent 49cdd52 commit bf7181b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frontend/src/scenes/surveys/surveyLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,8 @@ export const surveyLogic = kea<surveyLogicType>([

// Zero-fill choices that are not open-ended
question.choices.forEach((choice, idx) => {
if (
results?.length &&
idx === question.choices.length - 1 &&
question?.has_open_choice &&
!results.some((r) => r[1] === choice)
) {
const isOpenChoice = idx == question.choices.length - 1 && question?.has_open_choice
if (results?.length && !isOpenChoice && !results.some((r) => r[1] === choice)) {
results.push([0, choice])
}
})
Expand Down

0 comments on commit bf7181b

Please sign in to comment.