From 8978ed0ff34c4d164ab67ad25f03951c8d5eaf5f Mon Sep 17 00:00:00 2001 From: Lasse Capel Date: Wed, 20 Nov 2024 09:54:31 +0100 Subject: [PATCH] use a descriptive anique filename when downloading the files to zip --- app/lib/stores/workbench.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index dbdd689..7eed952 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -334,9 +334,6 @@ export class WorkbenchStore { const timestampHash = Date.now().toString(36).slice(-6); const uniqueProjectName = `${projectName}_${timestampHash}`; - // Prompt the user for a file name, prefilled with the project name - const fileName = prompt('Enter the file name', `${uniqueProjectName}.zip`); - for (const [filePath, dirent] of Object.entries(files)) { if (dirent?.type === 'file' && !dirent.isBinary) { const relativePath = extractRelativePath(filePath); @@ -358,15 +355,10 @@ export class WorkbenchStore { } } } - - - - - if (fileName) { // Generate the zip file and save it const content = await zip.generateAsync({ type: 'blob' }); - saveAs(content, fileName); - } + saveAs(content, `${uniqueProjectName}.zip`); + } async syncFiles(targetHandle: FileSystemDirectoryHandle) {