mirror of
https://github.com/bitwarden/android.git
synced 2026-06-07 23:58:03 -05:00
Disable login button when password is blank (#441)
This commit is contained in:
committed by
Álison Fernandes
parent
492038f163
commit
e92c85005b
@@ -42,7 +42,7 @@ class LoginViewModel @Inject constructor(
|
||||
initialState = savedStateHandle[KEY_STATE]
|
||||
?: LoginState(
|
||||
emailAddress = LoginArgs(savedStateHandle).emailAddress,
|
||||
isLoginButtonEnabled = true,
|
||||
isLoginButtonEnabled = false,
|
||||
passwordInput = "",
|
||||
environmentLabel = environmentRepository.environment.label,
|
||||
loadingDialogState = LoadingDialogState.Hidden,
|
||||
@@ -208,7 +208,12 @@ class LoginViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun handlePasswordInputChanged(action: LoginAction.PasswordInputChanged) {
|
||||
mutableStateFlow.update { it.copy(passwordInput = action.input) }
|
||||
mutableStateFlow.update {
|
||||
it.copy(
|
||||
passwordInput = action.input,
|
||||
isLoginButtonEnabled = action.input.isNotBlank(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user