add suport to drop collections
This commit is contained in:
parent
e1107ffdf7
commit
94b3aa88b9
2 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue