GoogleFragment: Move authevent check to flow collector

lint warns that when checks are exhastive otherwise

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-03-23 17:24:45 +08:00
parent ceca1799c7
commit dfce3ab990

View File

@@ -110,13 +110,13 @@ class GoogleFragment : BaseFragment<FragmentGoogleBinding>() {
} }
viewLifecycleOwner.lifecycleScope.launch { 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) { private fun onEventReceived(event: AuthEvent.GoogleLogin) {
when (event) {
is AuthEvent.GoogleLogin -> {
if (event.success) { if (event.success) {
viewModel.buildGoogleAuthData(event.email, event.token, AuthHelper.Token.AAS) viewModel.buildGoogleAuthData(event.email, event.token, AuthHelper.Token.AAS)
} else { } else {
@@ -131,8 +131,4 @@ class GoogleFragment : BaseFragment<FragmentGoogleBinding>() {
GoogleFragmentDirections.actionGoogleFragmentToSplashFragment() GoogleFragmentDirections.actionGoogleFragmentToSplashFragment()
) )
} }
else -> {}
}
}
} }