diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx index 776a7e25c1409..216df4368250d 100644 --- a/frontend/src/scenes/surveys/SurveyEdit.tsx +++ b/frontend/src/scenes/surveys/SurveyEdit.tsx @@ -112,7 +112,9 @@ export default function SurveyEdit(): JSX.Element { }, ] - if (featureFlags[FEATURE_FLAGS.SURVEYS_ADAPTIVE_LIMITS]) { + const adaptiveLimitFFEnabled = featureFlags[FEATURE_FLAGS.SURVEYS_ADAPTIVE_LIMITS] + + if (adaptiveLimitFFEnabled) { surveyLimitOptions.push({ value: 'until_adaptive_limit', label: 'Collect a certain number of surveys per day, week or month', @@ -120,15 +122,16 @@ export default function SurveyEdit(): JSX.Element { disabledReason: surveysAdaptiveLimitsDisabledReason, } as unknown as LemonRadioOption<'until_stopped' | 'until_limit' | 'until_adaptive_limit'>) } + useMemo(() => { if (surveyUsesLimit) { setDataCollectionType('until_limit') - } else if (surveyUsesAdaptiveLimit) { + } else if (surveyUsesAdaptiveLimit && adaptiveLimitFFEnabled) { setDataCollectionType('until_adaptive_limit') } else { setDataCollectionType('until_stopped') } - }, [surveyUsesLimit, surveyUsesAdaptiveLimit, setDataCollectionType]) + }, [surveyUsesLimit, surveyUsesAdaptiveLimit, adaptiveLimitFFEnabled, setDataCollectionType]) if (survey.iteration_count && survey.iteration_count > 0) { setSchedule('recurring')