mirror of
https://github.com/bitwarden/android.git
synced 2025-12-11 04:39:19 -06:00
PM-19399: Do not show 'Share error details' button when user enter incorrect password (#4905)
This commit is contained in:
parent
21af60f4de
commit
94a91702cc
@ -343,7 +343,7 @@ class VaultUnlockViewModel @Inject constructor(
|
||||
} else {
|
||||
state.vaultUnlockType.unlockScreenErrorMessage
|
||||
},
|
||||
throwable = result.error,
|
||||
throwable = result.error?.takeIf { _ -> action.isBiometricLogin },
|
||||
),
|
||||
)
|
||||
}
|
||||
@ -484,13 +484,6 @@ data class VaultUnlockState(
|
||||
*/
|
||||
val showKeyboard: Boolean get() = !showBiometricLogin && !hideInput
|
||||
|
||||
/**
|
||||
* Indicates if the vault is being unlocked as a result of receiving a FIDO 2 request.
|
||||
*/
|
||||
val isUnlockingForFido2Request: Boolean
|
||||
get() = fido2GetCredentialsRequest != null ||
|
||||
fido2CredentialAssertionRequest != null
|
||||
|
||||
/**
|
||||
* Returns the user ID present in the current FIDO 2 request, or null when no FIDO 2 request is
|
||||
* present.
|
||||
|
||||
@ -767,10 +767,9 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
|
||||
vaultUnlockType = VaultUnlockType.MASTER_PASSWORD,
|
||||
)
|
||||
val viewModel = createViewModel(state = initialState)
|
||||
val error = Throwable("Fail")
|
||||
coEvery {
|
||||
vaultRepository.unlockVaultWithMasterPassword(password)
|
||||
} returns VaultUnlockResult.AuthenticationError(error = error)
|
||||
} returns VaultUnlockResult.AuthenticationError(error = Throwable("Fail"))
|
||||
|
||||
viewModel.trySendAction(VaultUnlockAction.UnlockClick)
|
||||
assertEquals(
|
||||
@ -778,7 +777,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
|
||||
dialog = VaultUnlockState.VaultUnlockDialog.Error(
|
||||
R.string.an_error_has_occurred.asText(),
|
||||
R.string.invalid_master_password.asText(),
|
||||
throwable = error,
|
||||
),
|
||||
),
|
||||
viewModel.stateFlow.value,
|
||||
@ -937,10 +935,9 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
|
||||
vaultUnlockType = VaultUnlockType.PIN,
|
||||
)
|
||||
val viewModel = createViewModel(state = initialState)
|
||||
val error = Throwable("Fail")
|
||||
coEvery {
|
||||
vaultRepository.unlockVaultWithPin(pin)
|
||||
} returns VaultUnlockResult.AuthenticationError(error = error)
|
||||
} returns VaultUnlockResult.AuthenticationError(error = Throwable("Fail"))
|
||||
|
||||
viewModel.trySendAction(VaultUnlockAction.UnlockClick)
|
||||
assertEquals(
|
||||
@ -948,7 +945,6 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
|
||||
dialog = VaultUnlockState.VaultUnlockDialog.Error(
|
||||
title = R.string.an_error_has_occurred.asText(),
|
||||
message = R.string.invalid_pin.asText(),
|
||||
throwable = error,
|
||||
),
|
||||
),
|
||||
viewModel.stateFlow.value,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user