Skip to content

Commit

Permalink
fix(surveys): display thank you message null state bug fix (#20284)
Browse files Browse the repository at this point in the history
getting property of null bug fix
  • Loading branch information
liyiy authored Feb 13, 2024
1 parent c1ffba5 commit 17e92ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function SurveyEdit(): JSX.Element {
),
})
),
...(survey.appearance.displayThankYouMessage
...(survey.appearance?.displayThankYouMessage
? [
{
key: survey.questions.length,
Expand Down Expand Up @@ -322,7 +322,7 @@ export default function SurveyEdit(): JSX.Element {
</Link>
)}
</div>
{!survey.appearance.displayThankYouMessage && (
{!survey.appearance?.displayThankYouMessage && (
<LemonButton
type="secondary"
className="w-max mt-2"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/surveys/SurveyFormAppearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function SurveyFormAppearance({
setActivePreview,
isEditingSurvey,
}: SurveyFormAppearanceProps): JSX.Element {
const showThankYou = survey.appearance.displayThankYouMessage && activePreview >= survey.questions.length
const showThankYou = survey.appearance?.displayThankYouMessage && activePreview >= survey.questions.length

return survey.type !== SurveyType.API ? (
<>
Expand Down Expand Up @@ -48,7 +48,7 @@ export function SurveyFormAppearance({
label: `${index + 1}. ${question.question ?? ''}`,
value: index,
})),
...(survey.appearance.displayThankYouMessage
...(survey.appearance?.displayThankYouMessage
? [
{
label: `${survey.questions.length + 1}. Confirmation message`,
Expand Down

0 comments on commit 17e92ef

Please sign in to comment.