Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6d79b95

Browse files
authored
Add root folder to zip file created by export chat feature (#7097)
Signed-off-by: Aaron Raimist <[email protected]>
1 parent bafeb38 commit 6d79b95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/exportUtils/Exporter.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,16 @@ export default abstract class Exporter {
7777

7878
protected async downloadZIP(): Promise<string | void> {
7979
const brand = SdkConfig.get().brand;
80-
const filename = `${brand} - Chat Export - ${formatFullDateNoDay(new Date())}.zip`;
80+
const filenameWithoutExt = `${brand} - Chat Export - ${formatFullDateNoDay(new Date())}`;
81+
const filename = `${filenameWithoutExt}.zip`;
8182
const { default: JSZip } = await import('jszip');
8283

8384
const zip = new JSZip();
8485
// Create a writable stream to the directory
8586
if (!this.cancelled) this.updateProgress("Generating a ZIP");
8687
else return this.cleanUp();
8788

88-
for (const file of this.files) zip.file(file.name, file.blob);
89+
for (const file of this.files) zip.file(filenameWithoutExt + "/" + file.name, file.blob);
8990

9091
const content = await zip.generateAsync({ type: "blob" });
9192

0 commit comments

Comments
 (0)