diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx index b6bf810e73577..618201395ab88 100644 --- a/frontend/src/scenes/surveys/SurveyEdit.tsx +++ b/frontend/src/scenes/surveys/SurveyEdit.tsx @@ -113,7 +113,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', @@ -121,15 +123,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')