From cc63ae4172e3f97e61616a8a2d63dfb2bb17f592 Mon Sep 17 00:00:00 2001 From: vferraro-scottlogic Date: Fri, 22 Sep 2023 10:49:41 +0100 Subject: [PATCH] POC-use json state for save --- .../vuu-shell/src/layout-management/useLayoutManager.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vuu-ui/packages/vuu-shell/src/layout-management/useLayoutManager.tsx b/vuu-ui/packages/vuu-shell/src/layout-management/useLayoutManager.tsx index c6fa42ebb..ced7c003d 100644 --- a/vuu-ui/packages/vuu-shell/src/layout-management/useLayoutManager.tsx +++ b/vuu-ui/packages/vuu-shell/src/layout-management/useLayoutManager.tsx @@ -42,20 +42,16 @@ export const LayoutManagementProvider = (props: { }, []); const saveLayout = useCallback((metadata: Omit) => { - const json = getLocalEntity("api/vui"); - if (json) { // Persist layouts - const generatedId = persistenceManager.saveLayout(metadata, json); + const generatedId = persistenceManager.saveLayout(metadata, tempLayout); // Update state const newMetadata: LayoutMetadata = { ...metadata, id: generatedId }; - setLayoutMetadata(prev => [...prev, newMetadata]); - } }, []) const loadLayoutById = useCallback((id: string) => {