diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx index 7fca119b469bf..975ab2bd78c49 100644 --- a/frontend/src/scenes/surveys/SurveyEdit.tsx +++ b/frontend/src/scenes/surveys/SurveyEdit.tsx @@ -201,7 +201,7 @@ export default function SurveyEdit(): JSX.Element { ), }) ), - ...(survey.appearance.displayThankYouMessage + ...(survey.appearance?.displayThankYouMessage ? [ { key: survey.questions.length, @@ -322,7 +322,7 @@ export default function SurveyEdit(): JSX.Element { )} - {!survey.appearance.displayThankYouMessage && ( + {!survey.appearance?.displayThankYouMessage && ( = survey.questions.length + const showThankYou = survey.appearance?.displayThankYouMessage && activePreview >= survey.questions.length return survey.type !== SurveyType.API ? ( <> @@ -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`,