Skip to content

Commit

Permalink
POC-use json state for save
Browse files Browse the repository at this point in the history
  • Loading branch information
vferraro-scottlogic committed Sep 22, 2023
1 parent 4f7b742 commit cc63ae4
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,16 @@ export const LayoutManagementProvider = (props: {
}, []);

const saveLayout = useCallback((metadata: Omit<LayoutMetadata, "id">) => {
const json = getLocalEntity<LayoutJSON>("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) => {
Expand Down

0 comments on commit cc63ae4

Please sign in to comment.