-
Notifications
You must be signed in to change notification settings - Fork 0
Login Logic updated. #7
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: feature/login_screen
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ class LoginViewModel(private val loginRepository: LoginRepository) : ViewModel() | |
|
|
||
| private val _loginForm = MutableLiveData<LoginFormState>() | ||
| val loginFormState: LiveData<LoginFormState> = _loginForm | ||
| var IsUserLoggedIn = false | ||
|
|
||
| private val _loginResult = MutableLiveData<LoginResult>() | ||
| val loginResult: LiveData<LoginResult> = _loginResult | ||
|
|
@@ -42,9 +43,9 @@ class LoginViewModel(private val loginRepository: LoginRepository) : ViewModel() | |
| // A placeholder username validation check | ||
| private fun isUserNameValid(username: String): Boolean { | ||
| return if (username.contains('@')) { | ||
| Patterns.EMAIL_ADDRESS.matcher(username).matches() | ||
| !Patterns.EMAIL_ADDRESS.matcher(username).matches() | ||
| } else { | ||
| username.isNotBlank() | ||
| username.isBlank() | ||
| } | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 AIReviewRadar Thank you for the patch. Here's my review:
Here's the updated diff with the suggested changes: @@ -42,9 +43,9 @@ class LoginViewModel(private val loginRepository: LoginRepository) : ViewModel()
// A placeholder username validation check
private fun isUserNameValid(username: String): Boolean {
return if (username.contains('@')) {
- !Patterns.EMAIL_ADDRESS.matcher(username).matches()
+ Patterns.EMAIL_ADDRESS.matcher(username).matches()
} else {
- username.isBlank()
+ username.isNotBlank()
}
}Please make the necessary changes and let me know if you have any questions or need further assistance. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
🤖 AIReviewRadar
Thank you for the patch. Here's my review:
IsUserLoggedInshould follow the naming convention of lower camel case and be renamed toisUserLoggedIn.Here's the updated diff with the suggested changes:
Please make the necessary changes and let me know if you have any questions or need further assistance.