diff --git a/frontend/src/scenes/surveys/Surveys.tsx b/frontend/src/scenes/surveys/Surveys.tsx index b6e969e01c649..1252eef3172b8 100644 --- a/frontend/src/scenes/surveys/Surveys.tsx +++ b/frontend/src/scenes/surveys/Surveys.tsx @@ -60,7 +60,8 @@ export function Surveys(): JSX.Element { const { user } = useValues(userLogic) const { currentTeam } = useValues(teamLogic) - const surveysPopupDisabled = currentTeam && !currentTeam?.surveys_opt_in + const surveysPopupDisabled = + currentTeam && !currentTeam?.surveys_opt_in && surveys.some((s) => s.start_date && !s.end_date) const [tab, setSurveyTab] = useState(SurveysTabs.Active) const shouldShowEmptyState = !surveysLoading && surveys.length === 0 @@ -139,7 +140,8 @@ export function Surveys(): JSX.Element { }} className="mb-2" > - Survey popovers are currently disabled for this project. + Survey popovers are currently disabled for this project but there are active surveys running. + Re-enable them in the settings. ) : null} diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx index fa6c07f314d4f..a9476839eb672 100644 --- a/frontend/src/scenes/surveys/surveyLogic.tsx +++ b/frontend/src/scenes/surveys/surveyLogic.tsx @@ -424,8 +424,8 @@ export const surveyLogic = kea([ stopSurveySuccess: ({ survey }) => { actions.loadSurveys() if (values.currentTeam?.surveys_opt_in === true) { - const allActiveSurveys = values.surveys.filter((s) => s.start_date && !s.end_date) - if (allActiveSurveys.length === 0) { + const hasActiveSurveys = values.surveys.some((s) => s.start_date && !s.end_date) + if (!hasActiveSurveys) { actions.setSurveysOptIn(false) } }