mirror of
https://github.com/bitwarden/android.git
synced 2026-06-06 14:28:45 -05:00
Add biometrics state to UnlockVaultViewModel (#815)
This commit is contained in:
committed by
Álison Fernandes
parent
49e3d555e3
commit
78a256ae3f
@@ -53,6 +53,7 @@ class VaultUnlockViewModel @Inject constructor(
|
||||
dialog = null,
|
||||
environmentUrl = environmentRepo.environment.label,
|
||||
input = "",
|
||||
isBiometricEnabled = userState.activeAccount.isBiometricsEnabled,
|
||||
vaultUnlockType = userState.activeAccount.vaultUnlockType,
|
||||
)
|
||||
},
|
||||
@@ -87,13 +88,7 @@ class VaultUnlockViewModel @Inject constructor(
|
||||
is VaultUnlockAction.LogoutAccountClick -> handleLogoutAccountClick(action)
|
||||
is VaultUnlockAction.SwitchAccountClick -> handleSwitchAccountClick(action)
|
||||
VaultUnlockAction.UnlockClick -> handleUnlockClick()
|
||||
is VaultUnlockAction.Internal.ReceiveVaultUnlockResult -> {
|
||||
handleReceiveVaultUnlockResult(action)
|
||||
}
|
||||
|
||||
is VaultUnlockAction.Internal.UserStateUpdateReceive -> {
|
||||
handleUserStateUpdateReceive(action)
|
||||
}
|
||||
is VaultUnlockAction.Internal -> handleInternalAction(action)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +148,18 @@ class VaultUnlockViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleInternalAction(action: VaultUnlockAction.Internal) {
|
||||
when (action) {
|
||||
is VaultUnlockAction.Internal.ReceiveVaultUnlockResult -> {
|
||||
handleReceiveVaultUnlockResult(action)
|
||||
}
|
||||
|
||||
is VaultUnlockAction.Internal.UserStateUpdateReceive -> {
|
||||
handleUserStateUpdateReceive(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleReceiveVaultUnlockResult(
|
||||
action: VaultUnlockAction.Internal.ReceiveVaultUnlockResult,
|
||||
) {
|
||||
@@ -211,6 +218,7 @@ class VaultUnlockViewModel @Inject constructor(
|
||||
avatarColorString = activeAccountSummary.avatarColorHex,
|
||||
accountSummaries = accountSummaries,
|
||||
email = activeAccountSummary.email,
|
||||
isBiometricEnabled = userState.activeAccount.isBiometricsEnabled,
|
||||
vaultUnlockType = userState.activeAccount.vaultUnlockType,
|
||||
)
|
||||
}
|
||||
@@ -229,6 +237,7 @@ data class VaultUnlockState(
|
||||
val environmentUrl: String,
|
||||
val dialog: VaultUnlockDialog?,
|
||||
val input: String,
|
||||
val isBiometricEnabled: Boolean,
|
||||
val vaultUnlockType: VaultUnlockType,
|
||||
) : Parcelable {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user