-
Notifications
You must be signed in to change notification settings - Fork 8
Fix/login button #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Fix/login button #592
Conversation
viewmodel/src/main/java/com/cairosquad/viewmodel/login/LoginViewModel.kt
Show resolved
Hide resolved
Test Results 144 files 144 suites 3m 4s ⏱️ For more details on these failures, see this check. Results for commit 3ebf4f6. |
| val currentUsername = screenState.value.username | ||
| val currentPassword = screenState.value.password | ||
|
|
||
| if (currentUsername.isBlank() && currentPassword.isBlank()) { | ||
| return | ||
| } | ||
|
|
||
| if (currentUsername == lastTriedUsername && currentPassword == lastTriedPassword) { | ||
| return | ||
| } | ||
|
|
||
| lastTriedUsername = currentUsername | ||
| lastTriedPassword = currentPassword | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you just add these to a validator class, because the current implementation the user will not be able to know what is happening when press on the login button because nothing will happen and we should display an error message or something to tell the user the user name or the password is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also another question what if the user entered the user name and the password correctly but the request failed for some reason like because bad internet connection in this way he will not be able to try again because of the lastTriedUsername and the lastTriedPassword
so if we want to do that we should set these variables when we only get the wrong credentials error
No description provided.