mirror of
https://github.com/bitwarden/android.git
synced 2024-11-24 18:36:32 +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 vaultUnlockType = activeAccount.vaultUnlockType
|
||||||
val hasNoMasterPassword = !activeAccount.hasMasterPassword
|
val hasNoMasterPassword = !activeAccount.hasMasterPassword
|
||||||
val hideInput = hasNoMasterPassword && vaultUnlockType == VaultUnlockType.MASTER_PASSWORD
|
if (!activeAccount.hasManualUnlockMechanism) {
|
||||||
val isBiometricsEnabled = activeAccount.isBiometricsEnabled
|
|
||||||
if (hasNoMasterPassword && vaultUnlockType != VaultUnlockType.PIN && !isBiometricsEnabled) {
|
|
||||||
// There is no valid way to unlock this app.
|
// There is no valid way to unlock this app.
|
||||||
authRepository.logout()
|
authRepository.logout()
|
||||||
}
|
}
|
||||||
VaultUnlockState(
|
VaultUnlockState(
|
||||||
accountSummaries = accountSummaries,
|
accountSummaries = accountSummaries,
|
||||||
avatarColorString = activeAccountSummary.avatarColorHex,
|
avatarColorString = activeAccountSummary.avatarColorHex,
|
||||||
hideInput = hideInput,
|
hideInput = hasNoMasterPassword && vaultUnlockType == VaultUnlockType.MASTER_PASSWORD,
|
||||||
initials = activeAccountSummary.initials,
|
initials = activeAccountSummary.initials,
|
||||||
email = activeAccountSummary.email,
|
email = activeAccountSummary.email,
|
||||||
dialog = null,
|
dialog = null,
|
||||||
environmentUrl = environmentRepo.environment.label,
|
environmentUrl = environmentRepo.environment.label,
|
||||||
input = "",
|
input = "",
|
||||||
isBiometricEnabled = isBiometricsEnabled,
|
isBiometricEnabled = activeAccount.isBiometricsEnabled,
|
||||||
isBiometricsValid = isBiometricsValid,
|
isBiometricsValid = isBiometricsValid,
|
||||||
showAccountMenu = VaultUnlockArgs(savedStateHandle).unlockType == UnlockType.STANDARD,
|
showAccountMenu = VaultUnlockArgs(savedStateHandle).unlockType == UnlockType.STANDARD,
|
||||||
showBiometricInvalidatedMessage = false,
|
showBiometricInvalidatedMessage = false,
|
||||||
|
|
Loading…
Reference in a new issue