diff --git a/src/angular/components/export.component.ts b/src/angular/components/export.component.ts index d4192fed26..f85d4ef018 100644 --- a/src/angular/components/export.component.ts +++ b/src/angular/components/export.component.ts @@ -13,6 +13,7 @@ export class ExportComponent { formPromise: Promise; masterPassword: string; + format: 'json' | 'csv' = 'json'; showPassword = false; constructor(protected cryptoService: CryptoService, protected i18nService: I18nService, @@ -53,11 +54,11 @@ export class ExportComponent { } protected getExportData() { - return this.exportService.getExport('csv'); + return this.exportService.getExport(this.format); } protected getFileName(prefix?: string) { - return this.exportService.getFileName(prefix); + return this.exportService.getFileName(prefix, this.format); } private downloadFile(csv: string): void { diff --git a/src/services/export.service.ts b/src/services/export.service.ts index a105be6d8b..6492725494 100644 --- a/src/services/export.service.ts +++ b/src/services/export.service.ts @@ -166,7 +166,7 @@ export class ExportService implements ExportServiceAbstraction { cipher.build(c); jsonDoc.items.push(cipher); }); - return JSON.stringify({}, null, ' '); + return JSON.stringify(jsonDoc, null, ' '); } }