Commit
·
8978ed0
1
Parent(s):
399affd
use a descriptive anique filename when downloading the files to zip
Browse files- app/lib/stores/workbench.ts +2 -10
app/lib/stores/workbench.ts
CHANGED
@@ -334,9 +334,6 @@ export class WorkbenchStore {
|
|
334 |
const timestampHash = Date.now().toString(36).slice(-6);
|
335 |
const uniqueProjectName = `${projectName}_${timestampHash}`;
|
336 |
|
337 |
-
// Prompt the user for a file name, prefilled with the project name
|
338 |
-
const fileName = prompt('Enter the file name', `${uniqueProjectName}.zip`);
|
339 |
-
|
340 |
for (const [filePath, dirent] of Object.entries(files)) {
|
341 |
if (dirent?.type === 'file' && !dirent.isBinary) {
|
342 |
const relativePath = extractRelativePath(filePath);
|
@@ -358,15 +355,10 @@ export class WorkbenchStore {
|
|
358 |
}
|
359 |
}
|
360 |
}
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
if (fileName) {
|
366 |
// Generate the zip file and save it
|
367 |
const content = await zip.generateAsync({ type: 'blob' });
|
368 |
-
saveAs(content,
|
369 |
-
|
370 |
}
|
371 |
|
372 |
async syncFiles(targetHandle: FileSystemDirectoryHandle) {
|
|
|
334 |
const timestampHash = Date.now().toString(36).slice(-6);
|
335 |
const uniqueProjectName = `${projectName}_${timestampHash}`;
|
336 |
|
|
|
|
|
|
|
337 |
for (const [filePath, dirent] of Object.entries(files)) {
|
338 |
if (dirent?.type === 'file' && !dirent.isBinary) {
|
339 |
const relativePath = extractRelativePath(filePath);
|
|
|
355 |
}
|
356 |
}
|
357 |
}
|
|
|
|
|
|
|
|
|
|
|
358 |
// Generate the zip file and save it
|
359 |
const content = await zip.generateAsync({ type: 'blob' });
|
360 |
+
saveAs(content, `${uniqueProjectName}.zip`);
|
361 |
+
|
362 |
}
|
363 |
|
364 |
async syncFiles(targetHandle: FileSystemDirectoryHandle) {
|