From f20a0d2ff7c49a82cdce77f9f2c1e86e826c5318 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:12:32 +0530 Subject: [PATCH] fix: confirm modal on back button (#2189) --- .../surveys/[surveyId]/edit/components/SurveyEditor.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx index c1dee97069..40163721b6 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyEditor.tsx @@ -54,8 +54,6 @@ export default function SurveyEditor({ useEffect(() => { if (survey) { - if (localSurvey) return; - const surveyClone = structuredClone(survey); setLocalSurvey(surveyClone); @@ -63,7 +61,7 @@ export default function SurveyEditor({ setActiveQuestionId(survey.questions[0].id); } } - }, [localSurvey, survey]); + }, [survey]); useEffect(() => { const listener = () => {