From 19d54458130cb1557b2f21bd4d700825f5e74d74 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 29 May 2023 19:22:59 -0300 Subject: [PATCH] remove classname from edges on import --- src/frontend/src/contexts/tabsContext.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index a373ad9a7..8be0a7c69 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -85,6 +85,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { if (cookie && Object.keys(templates).length > 0) { let cookieObject: LangFlowState = JSON.parse(cookie); cookieObject.flows.forEach((flow) => { + flow.data.edges.forEach((edge) => {edge.className = "";}) flow.data.nodes.forEach((node) => { if (Object.keys(templates[node.data.type]["template"]).length > 0) { node.data.node.base_classes = @@ -285,8 +286,8 @@ export function TabsProvider({ children }: { children: ReactNode }) { // Get data from the flow or set it to null if there's no flow provided. const data = flow?.data ? flow.data : null; const description = flow?.description ? flow.description : ""; - if (data) { + data.edges.forEach((edge) => {edge.className = "";}) data.nodes.forEach((node) => { if (Object.keys(templates[node.data.type]["template"]).length > 0) { node.data.node.base_classes =