From 9359162d005d15b7493b8324953bb569a9c607a5 Mon Sep 17 00:00:00 2001 From: Fahath Mohamed Date: Sun, 10 Nov 2024 15:55:42 +0530 Subject: [PATCH] enhancement: allow user to specify project name for ZIP file --- app/lib/stores/workbench.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index c42cc6275..107ef16d4 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -278,6 +278,7 @@ export class WorkbenchStore { async downloadZip() { const zip = new JSZip(); const files = this.files.get(); + const projectName = prompt('Enter the project name:', 'project') || 'project'; for (const [filePath, dirent] of Object.entries(files)) { if (dirent?.type === 'file' && !dirent.isBinary) { @@ -303,7 +304,7 @@ export class WorkbenchStore { } const content = await zip.generateAsync({ type: 'blob' }); - saveAs(content, 'project.zip'); + saveAs(content, `${projectName}.zip`); } async syncFiles(targetHandle: FileSystemDirectoryHandle) {