Skip to content

Commit

Permalink
enable backup with decryption key in legacy crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Feb 4, 2025
1 parent 2737071 commit 9ee08b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/crypto/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ export class BackupManager {

const trustInfo = await this.isKeyBackupTrusted(backupInfo);

if (trustInfo.usable && !this.backupInfo) {
logger.log(`Found usable key backup v${backupInfo!.version}: enabling key backups`);
if ((trustInfo.usable || trustInfo.trusted_locally) && !this.backupInfo) {
logger.log(`Found usable key backup v${backupInfo!.version}: enabling key backups`);
await this.enableKeyBackup(backupInfo!);
} else if (!trustInfo.usable && this.backupInfo) {
} else if (!trustInfo.usable && !trustInfo.trusted_locally && this.backupInfo) {
logger.log("No usable key backup: disabling key backup");
this.disableKeyBackup();
} else if (!trustInfo.usable && !this.backupInfo) {
} else if (!trustInfo.usable && !trustInfo.trusted_locally && !this.backupInfo) {
logger.log("No usable key backup: not enabling key backup");
} else if (trustInfo.usable && this.backupInfo) {
} else if ((trustInfo.usable || trustInfo.trusted_locally) && this.backupInfo) {
// may not be the same version: if not, we should switch
if (backupInfo!.version !== this.backupInfo.version) {
logger.log(
Expand Down

0 comments on commit 9ee08b1

Please sign in to comment.