diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 1fc036ef1..3d24823bb 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -280,6 +280,12 @@ export function TabsProvider({ children }: { children: ReactNode }) { let id; if (file) { let text = await file.text(); + let fileData = JSON.parse(text); + if (fileData.flows) { + fileData.flows.forEach((flow: FlowType) => { + id = addFlow(flow, newProject); + }); + } // parse the text into a JSON object let flow: FlowType = JSON.parse(text); diff --git a/src/frontend/src/pages/MainPage/index.tsx b/src/frontend/src/pages/MainPage/index.tsx index 5921b3cc8..1f012b4c2 100644 --- a/src/frontend/src/pages/MainPage/index.tsx +++ b/src/frontend/src/pages/MainPage/index.tsx @@ -62,6 +62,7 @@ export default function HomePage(): JSX.Element { setIsDragging(false); if (e.dataTransfer.types.some((types) => types === "Files")) { if (e.dataTransfer.files.item(0).type === "application/json") { + console.log(e.dataTransfer.files.item(0)); uploadFlow(true, e.dataTransfer.files.item(0)!); } else { setErrorData({