mirror of
https://github.com/bitwarden/android.git
synced 2024-11-21 17:05:44 +03:00
Simplify manual unlock check (#3824)
This commit is contained in:
parent
9dbb40f33b
commit
38e693f92c
1 changed files with 3 additions and 5 deletions
|
@ -61,22 +61,20 @@ class VaultUnlockViewModel @Inject constructor(
|
|||
)
|
||||
val vaultUnlockType = activeAccount.vaultUnlockType
|
||||
val hasNoMasterPassword = !activeAccount.hasMasterPassword
|
||||
val hideInput = hasNoMasterPassword && vaultUnlockType == VaultUnlockType.MASTER_PASSWORD
|
||||
val isBiometricsEnabled = activeAccount.isBiometricsEnabled
|
||||
if (hasNoMasterPassword && vaultUnlockType != VaultUnlockType.PIN && !isBiometricsEnabled) {
|
||||
if (!activeAccount.hasManualUnlockMechanism) {
|
||||
// There is no valid way to unlock this app.
|
||||
authRepository.logout()
|
||||
}
|
||||
VaultUnlockState(
|
||||
accountSummaries = accountSummaries,
|
||||
avatarColorString = activeAccountSummary.avatarColorHex,
|
||||
hideInput = hideInput,
|
||||
hideInput = hasNoMasterPassword && vaultUnlockType == VaultUnlockType.MASTER_PASSWORD,
|
||||
initials = activeAccountSummary.initials,
|
||||
email = activeAccountSummary.email,
|
||||
dialog = null,
|
||||
environmentUrl = environmentRepo.environment.label,
|
||||
input = "",
|
||||
isBiometricEnabled = isBiometricsEnabled,
|
||||
isBiometricEnabled = activeAccount.isBiometricsEnabled,
|
||||
isBiometricsValid = isBiometricsValid,
|
||||
showAccountMenu = VaultUnlockArgs(savedStateHandle).unlockType == UnlockType.STANDARD,
|
||||
showBiometricInvalidatedMessage = false,
|
||||
|
|
Loading…
Reference in a new issue