From 1981321b1a6b73754f647772c1c51efc6f39d98b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 30 May 2023 00:41:07 -0300 Subject: [PATCH] format --- src/frontend/src/contexts/tabsContext.tsx | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 2c3103477..18927a480 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -60,29 +60,29 @@ export function TabsProvider({ children }: { children: ReactNode }) { } function save() { // added clone deep to avoid mutating the original object - let Saveflows = _.cloneDeep(flows); - if (Saveflows.length !== 0){ + let Saveflows = _.cloneDeep(flows); + if (Saveflows.length !== 0) { Saveflows.forEach((flow) => { - if(flow.data && flow.data?.nodes) flow.data?.nodes.forEach((node) => { - console.log(node.data.type) - //looking for file fields to prevent saving the content and breaking the flow for exceeding the the data limite for local storage - Object.keys(node.data.node.template).forEach((key) => { - console.log(node.data.node.template[key].type) - if(node.data.node.template[key].type==="file"){ - console.log(node.data.node.template[key]) - node.data.node.template[key].content = null; - node.data.node.template[key].value = ""; - - } - }) - }) - }) + if (flow.data && flow.data?.nodes) + flow.data?.nodes.forEach((node) => { + console.log(node.data.type); + //looking for file fields to prevent saving the content and breaking the flow for exceeding the the data limite for local storage + Object.keys(node.data.node.template).forEach((key) => { + console.log(node.data.node.template[key].type); + if (node.data.node.template[key].type === "file") { + console.log(node.data.node.template[key]); + node.data.node.template[key].content = null; + node.data.node.template[key].value = ""; + } + }); + }); + }); window.localStorage.setItem( - "tabsData", - JSON.stringify({ tabIndex, flows:Saveflows, id}) - ); + "tabsData", + JSON.stringify({ tabIndex, flows: Saveflows, id }) + ); } - } + } useEffect(() => { //save tabs locally save();