Skip to content

Commit

Permalink
do not show adaptive limits UI if feature flag is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanatic committed Dec 20, 2024
1 parent 0c0087f commit 15ac0eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,26 @@ 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',
'data-attr': 'survey-collection-until-adaptive-limit',
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')
Expand Down

0 comments on commit 15ac0eb

Please sign in to comment.