diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeViewModel.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeViewModel.kt index 65e2a62a..c3069475 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeViewModel.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeViewModel.kt @@ -73,7 +73,9 @@ class RecoveryCodeViewModel( keyManager.storeMainKey(seed) mRecoveryCodeSaved.setEvent(true) } else { - mExistingCodeChecked.setEvent(crypto.verifyBackupKey(seed)) + val verified = crypto.verifyBackupKey(seed) + if (verified && !keyManager.hasMainKey()) keyManager.storeMainKey(seed) + mExistingCodeChecked.setEvent(verified) } }