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

Fix export with attachments on formats txt and json #9851

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/utils/exportUtils/Exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default abstract class Exporter {

protected async downloadZIP(): Promise<string | void> {
const filename = this.destinationFileName;
const filenameWithoutExt = filename.substring(0, filename.length - 4); // take off the .zip
const filenameWithoutExt = filename.substring(0, filename.lastIndexOf(".")); // take off the extension
const { default: JSZip } = await import("jszip");

const zip = new JSZip();
Expand All @@ -103,8 +103,7 @@ export default abstract class Exporter {
for (const file of this.files) zip.file(filenameWithoutExt + "/" + file.name, file.blob);

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

saveAs(content, filename);
saveAs(content, filenameWithoutExt + ".zip");
}

protected cleanUp(): string {
Expand Down