diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 6968d6472..c77aa759c 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -388,7 +388,6 @@ export default function ParameterComponent({ suffixes={data.node?.template[name].suffixes} onFileChange={(filePath: string) => { data.node!.template[name].file_path = filePath; - save(); }} > diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 88f5005fe..1fc036ef1 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -36,7 +36,6 @@ import { typesContext } from "./typesContext"; const uid = new ShortUniqueId({ length: 5 }); const TabsContextInitialValue: TabsContextType = { - save: () => {}, tabId: "", setTabId: (index: string) => {}, isLoading: true, @@ -101,29 +100,6 @@ export function TabsProvider({ children }: { children: ReactNode }) { return newNodeId.current; } - function save() { - // added clone deep to avoid mutating the original object - let Saveflows = _.cloneDeep(flows); - if (Saveflows.length !== 0) { - Saveflows.forEach((flow) => { - if (flow.data && flow.data?.nodes) - flow.data?.nodes.forEach((node) => { - //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) => { - if (node.data.node.template[key].type === "file") { - node.data.node.template[key].content = null; - node.data.node.template[key].value = ""; - } - }); - }); - }); - window.localStorage.setItem( - "tabsData", - JSON.stringify({ tabId, flows: Saveflows, id }) - ); - } - } - function refreshFlows() { setIsLoading(true); getTabsDataFromDB().then((DbData) => { @@ -640,7 +616,6 @@ export function TabsProvider({ children }: { children: ReactNode }) { tabId, setTabId, flows, - save, incrementNodeId, removeFlow, addFlow, diff --git a/src/frontend/src/types/tabs/index.ts b/src/frontend/src/types/tabs/index.ts index a06b514a4..c1f45c700 100644 --- a/src/frontend/src/types/tabs/index.ts +++ b/src/frontend/src/types/tabs/index.ts @@ -3,7 +3,6 @@ import { FlowType } from "../flow"; export type TabsContextType = { saveFlow: (flow: FlowType, silent?: boolean) => Promise; - save: () => void; tabId: string; isLoading: boolean; setTabId: (index: string) => void;