fix(user-interaction): address review feedback

This commit is contained in:
Yichen Jiang
2026-07-30 17:59:37 +08:00
parent 31a498b1db
commit 3ba4d40e6a
16 changed files with 119 additions and 37 deletions

View File

@@ -280,8 +280,10 @@ function matchesQuestions(payload: QuestionResponsePayload, pending: PendingQues
if (new Set(answer.selected).size !== answer.selected.length) return false
const custom = answer.custom?.trim()
if (custom !== undefined && custom === '') return false
if (custom !== undefined && answer.selected.length > 0 && question.multiSelect !== true) return false
if (question.multiSelect !== true && answer.selected.length > 1) return false
if (question.multiSelect !== true) {
if (custom !== undefined && answer.selected.length > 0) return false
if (answer.selected.length > 1) return false
}
const labels = new Set(question.options?.map(option => option.label) ?? [])
return answer.selected.every(label => labels.has(label))
})