You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-20 20:42:03 +03:00
Fix export with attachments on formats txt and json (#9851)
* set file extension to .zip when needed * Apply prettier formatting Co-authored-by: grimhilt <grimhilt@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user