Skip to content
Snippets Groups Projects
Commit dfce3ab9 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

GoogleFragment: Move authevent check to flow collector


lint warns that when checks are exhastive otherwise

Signed-off-by: Aayush Gupta's avatarAayush Gupta <aayushgupta219@gmail.com>
parent ceca1799
No related branches found
No related tags found
No related merge requests found
......@@ -110,13 +110,13 @@ class GoogleFragment : BaseFragment<FragmentGoogleBinding>() {
}
viewLifecycleOwner.lifecycleScope.launch {
AuroraApp.events.authEvent.collect { onEventReceived(it) }
AuroraApp.events.authEvent.collect { event ->
if (event is AuthEvent.GoogleLogin) onEventReceived(event)
}
}
}
private fun onEventReceived(event: AuthEvent) {
when (event) {
is AuthEvent.GoogleLogin -> {
private fun onEventReceived(event: AuthEvent.GoogleLogin) {
if (event.success) {
viewModel.buildGoogleAuthData(event.email, event.token, AuthHelper.Token.AAS)
} else {
......@@ -131,8 +131,4 @@ class GoogleFragment : BaseFragment<FragmentGoogleBinding>() {
GoogleFragmentDirections.actionGoogleFragmentToSplashFragment()
)
}
else -> {}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment