diff --git a/gui/src/app/Project/ProjectSerialization.ts b/gui/src/app/Project/ProjectSerialization.ts index 45cbff21..4ed6c132 100644 --- a/gui/src/app/Project/ProjectSerialization.ts +++ b/gui/src/app/Project/ProjectSerialization.ts @@ -60,7 +60,9 @@ export const serializeAsZip = async ( throw new Error("Error creating folder in zip file"); } Object.entries(fileManifest).forEach(([name, content]) => { - folder.file(name, content); + if (content.trim() !== "") { + folder.file(name, content); + } }); const zipBlob = await zip.generateAsync({ type: "blob" }); diff --git a/gui/src/app/pages/HomePage/SaveProjectWindow.tsx b/gui/src/app/pages/HomePage/SaveProjectWindow.tsx index d620d071..42dcd0d4 100644 --- a/gui/src/app/pages/HomePage/SaveProjectWindow.tsx +++ b/gui/src/app/pages/HomePage/SaveProjectWindow.tsx @@ -1,6 +1,6 @@ import { FunctionComponent, useCallback, useContext, useState } from "react"; -import { serializeAsZip } from "@SpCore//ProjectSerialization"; +import { serializeAsZip } from "@SpCore/ProjectSerialization"; import { FileRegistry, mapModelToFileManifest } from "@SpCore/FileMapping"; import { ProjectContext } from "@SpCore/ProjectContextProvider"; import saveAsGitHubGist from "@SpCore/gists/saveAsGitHubGist"; @@ -35,12 +35,15 @@ const SaveProjectWindow: FunctionComponent = ({ /> - {Object.entries(fileManifest).map(([name, content], i) => ( - - {name} - {content.length} bytes - - ))} + {Object.entries(fileManifest).map( + ([name, content], i) => + content.trim() !== "" && ( + + {name} + {content.length} bytes + + ), + )}