From 6fe130ca9ed9f06c0b9f694d8104a37deaf5c616 Mon Sep 17 00:00:00 2001 From: Nina Kylstad Date: Tue, 23 Apr 2024 09:44:22 +0200 Subject: [PATCH 1/2] Ensure autosave on layoutset switch is done for correct layoutset. --- .../packages/ux-editor/src/containers/FormItemContext.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/packages/ux-editor/src/containers/FormItemContext.tsx b/frontend/packages/ux-editor/src/containers/FormItemContext.tsx index 2bd5ab8d532..e4dc771f1b9 100644 --- a/frontend/packages/ux-editor/src/containers/FormItemContext.tsx +++ b/frontend/packages/ux-editor/src/containers/FormItemContext.tsx @@ -67,13 +67,13 @@ export const FormItemContextProvider = ({ org, app, prevSelectedFormLayoutNameRef.current, - selectedFormLayoutSetName, + prevSelectedFormLayoutSetNameRef.current, ); const { mutateAsync: updateFormComponent } = useUpdateFormComponentMutation( org, app, prevSelectedFormLayoutNameRef.current, - selectedFormLayoutSetName, + prevSelectedFormLayoutSetNameRef.current, ); useEffect(() => { From 9f1dc92ab1abc3faecd16327f00011f18e0b8cd0 Mon Sep 17 00:00:00 2001 From: Nina Kylstad Date: Wed, 24 Apr 2024 10:11:40 +0200 Subject: [PATCH 2/2] fixed layoutset ref to use correct value --- .../packages/ux-editor/src/containers/FormItemContext.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/packages/ux-editor/src/containers/FormItemContext.tsx b/frontend/packages/ux-editor/src/containers/FormItemContext.tsx index e4dc771f1b9..4962808bd80 100644 --- a/frontend/packages/ux-editor/src/containers/FormItemContext.tsx +++ b/frontend/packages/ux-editor/src/containers/FormItemContext.tsx @@ -67,13 +67,13 @@ export const FormItemContextProvider = ({ org, app, prevSelectedFormLayoutNameRef.current, - prevSelectedFormLayoutSetNameRef.current, + selectedFormLayoutSetName, ); const { mutateAsync: updateFormComponent } = useUpdateFormComponentMutation( org, app, prevSelectedFormLayoutNameRef.current, - prevSelectedFormLayoutSetNameRef.current, + selectedFormLayoutSetName, ); useEffect(() => { @@ -153,7 +153,7 @@ export const FormItemContextProvider = ({ return; await handleSave(); handleDiscard(); - prevSelectedFormLayoutSetNameRef.current = selectedFormLayoutName; + prevSelectedFormLayoutSetNameRef.current = selectedFormLayoutSetName; prevSelectedFormLayoutNameRef.current = selectedFormLayoutName; };