refactor: import/export use cases (#2397)

This commit is contained in:
Mo
2023-08-10 08:08:17 -05:00
committed by GitHub
parent 5bb749b601
commit 1e965caf18
43 changed files with 1085 additions and 673 deletions

View File

@@ -39,14 +39,16 @@ export class ArchiveManager {
}
public async downloadBackup(encrypted: boolean): Promise<void> {
const data = encrypted
? await this.application.createEncryptedBackupFile()
: await this.application.createDecryptedBackupFile()
const result = encrypted
? await this.application.createEncryptedBackupFile.execute()
: await this.application.createDecryptedBackupFile.execute()
if (!data) {
if (result.isFailed()) {
return
}
const data = result.getValue()
const blobData = new Blob([JSON.stringify(data, null, 2)], {
type: 'text/json',
})