mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Add root folder to zip file created by export chat feature (#7097)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
bafeb38472
commit
6d79b95876
1 changed files with 3 additions and 2 deletions
|
@ -77,7 +77,8 @@ export default abstract class Exporter {
|
|||
|
||||
protected async downloadZIP(): Promise<string | void> {
|
||||
const brand = SdkConfig.get().brand;
|
||||
const filename = `${brand} - Chat Export - ${formatFullDateNoDay(new Date())}.zip`;
|
||||
const filenameWithoutExt = `${brand} - Chat Export - ${formatFullDateNoDay(new Date())}`;
|
||||
const filename = `${filenameWithoutExt}.zip`;
|
||||
const { default: JSZip } = await import('jszip');
|
||||
|
||||
const zip = new JSZip();
|
||||
|
@ -85,7 +86,7 @@ export default abstract class Exporter {
|
|||
if (!this.cancelled) this.updateProgress("Generating a ZIP");
|
||||
else return this.cleanUp();
|
||||
|
||||
for (const file of this.files) zip.file(file.name, file.blob);
|
||||
for (const file of this.files) zip.file(filenameWithoutExt + "/" + file.name, file.blob);
|
||||
|
||||
const content = await zip.generateAsync({ type: "blob" });
|
||||
|
||||
|
|
Loading…
Reference in a new issue