Skip to content

Commit

Permalink
fix: no longer persist Survey editing state (#27996)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasheriques authored and adamleithp committed Jan 29, 2025
1 parent 1ab41ca commit a03f146
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/scenes/surveys/Survey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FlagSelector } from 'lib/components/FlagSelector'
import { NotFound } from 'lib/components/NotFound'
import { PageHeader } from 'lib/components/PageHeader'
import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { useEffect } from 'react'
import { featureFlagLogic } from 'scenes/feature-flags/featureFlagLogic'
import { FeatureFlagReleaseConditions } from 'scenes/feature-flags/FeatureFlagReleaseConditions'
import { SceneExport } from 'scenes/sceneTypes'
Expand All @@ -27,8 +28,15 @@ export const scene: SceneExport = {
}

export function SurveyComponent({ id }: { id?: string } = {}): JSX.Element {
const { editingSurvey } = useActions(surveyLogic)
const { isEditingSurvey, surveyMissing } = useValues(surveyLogic)

useEffect(() => {
return () => {
editingSurvey(false)
}
}, [editingSurvey])

if (surveyMissing) {
return <NotFound object="survey" />
}
Expand Down

0 comments on commit a03f146

Please sign in to comment.