mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Save valid backup key before downloading keys
This commit is contained in:
parent
db84c679b4
commit
3c931d6f6d
1 changed files with 4 additions and 3 deletions
|
@ -671,7 +671,6 @@ internal class DefaultKeysBackupService @Inject constructor(
|
|||
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key for this keys version")
|
||||
throw InvalidParameterException("Invalid recovery key")
|
||||
}
|
||||
|
||||
// Get a PK decryption instance
|
||||
pkDecryptionFromRecoveryKey(recoveryKey)
|
||||
}
|
||||
|
@ -680,6 +679,10 @@ internal class DefaultKeysBackupService @Inject constructor(
|
|||
Timber.e("restoreKeysWithRecoveryKey: Invalid recovery key. Error")
|
||||
throw InvalidParameterException("Invalid recovery key")
|
||||
}
|
||||
|
||||
// Save for next time and for gossiping
|
||||
// Save now as it's valid, don't wait for the import as it could take long.
|
||||
saveBackupRecoveryKey(recoveryKey, keysVersionResult.version)
|
||||
|
||||
stepProgressListener?.onStepProgress(StepProgressListener.Step.DownloadingKey)
|
||||
|
||||
|
@ -729,8 +732,6 @@ internal class DefaultKeysBackupService @Inject constructor(
|
|||
if (backUp) {
|
||||
maybeBackupKeys()
|
||||
}
|
||||
// Save for next time and for gossiping
|
||||
saveBackupRecoveryKey(recoveryKey, keysVersionResult.version)
|
||||
result
|
||||
}
|
||||
}.foldToCallback(callback)
|
||||
|
|
Loading…
Reference in a new issue