mirror of
https://github.com/bitwarden/android.git
synced 2025-03-16 03:08:50 +03:00
Ensure trusted device is displayed before set password or reset password screens (#1250)
This commit is contained in:
parent
f01a67ea9c
commit
0bddd70d2a
2 changed files with 4 additions and 4 deletions
|
@ -61,13 +61,13 @@ class RootNavViewModel @Inject constructor(
|
|||
val userState = action.userState
|
||||
val specialCircumstance = action.specialCircumstance
|
||||
val updatedRootNavState = when {
|
||||
userState?.activeAccount?.trustedDevice?.isDeviceTrusted == false &&
|
||||
!userState.activeAccount.isVaultUnlocked -> RootNavState.TrustedDevice
|
||||
|
||||
userState?.activeAccount?.needsMasterPassword == true -> RootNavState.SetPassword
|
||||
|
||||
userState?.activeAccount?.needsPasswordReset == true -> RootNavState.ResetPassword
|
||||
|
||||
userState?.activeAccount?.trustedDevice?.isDeviceTrusted == false &&
|
||||
!userState.activeAccount.isVaultUnlocked -> RootNavState.TrustedDevice
|
||||
|
||||
userState == null ||
|
||||
!userState.activeAccount.isLoggedIn ||
|
||||
userState.hasPendingAccountAddition -> RootNavState.Auth
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test
|
|||
|
||||
class RootNavViewModelTest : BaseViewModelTest() {
|
||||
private val mutableUserStateFlow = MutableStateFlow<UserState?>(null)
|
||||
private val authRepository = mockk<AuthRepository>() {
|
||||
private val authRepository = mockk<AuthRepository> {
|
||||
every { userStateFlow } returns mutableUserStateFlow
|
||||
every { updateLastActiveTime() } just runs
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue