mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-01 11:22:46 -05:00
Fix saved changes are not visible in Survey Editor (#674)
This commit is contained in:
+2
-4
@@ -29,11 +29,9 @@ export default function SurveyEditor({ environmentId, surveyId }: SurveyEditorPr
|
||||
|
||||
useEffect(() => {
|
||||
if (survey) {
|
||||
if (!localSurvey) {
|
||||
setLocalSurvey(survey);
|
||||
}
|
||||
setLocalSurvey(survey);
|
||||
|
||||
if (!activeQuestionId && survey.questions.length > 0) {
|
||||
if (survey.questions.length > 0) {
|
||||
setActiveQuestionId(survey.questions[0].id);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -65,7 +65,8 @@ export default function SurveyMenuBar({
|
||||
|
||||
// write a function which updates the local survey status
|
||||
const updateLocalSurveyStatus = (status: Survey["status"]) => {
|
||||
const updatedSurvey = { ...localSurvey, status };
|
||||
const updatedSurvey = JSON.parse(JSON.stringify(localSurvey));
|
||||
updatedSurvey.status = status;
|
||||
setLocalSurvey(updatedSurvey);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user