@@ -6,6 +6,8 @@ import androidx.compose.runtime.mutableStateOf
66import androidx.compose.runtime.rememberCoroutineScope
77import androidx.compose.runtime.setValue
88import com.ninecraft.booket.core.common.analytics.AnalyticsHelper
9+ import com.ninecraft.booket.core.common.constants.ErrorScope
10+ import com.ninecraft.booket.core.common.utils.postErrorDialog
911import com.ninecraft.booket.core.data.api.repository.AuthRepository
1012import com.ninecraft.booket.core.data.api.repository.UserRepository
1113import com.ninecraft.booket.feature.screens.HomeScreen
@@ -60,10 +62,11 @@ class LoginPresenter @AssistedInject constructor(
6062 }
6163 }
6264 }.onFailure { exception ->
63- exception.message?.let { Logger .e(it) }
64- sideEffect = exception.message?.let {
65- LoginSideEffect .ShowToast (it)
66- }
65+ Logger .e(exception.message ? : " Failed to get user profile" )
66+ postErrorDialog(
67+ errorScope = ErrorScope .LOGIN ,
68+ exception = exception,
69+ )
6770 }
6871 }
6972 }
@@ -89,11 +92,12 @@ class LoginPresenter @AssistedInject constructor(
8992 .onSuccess {
9093 navigateAfterLogin()
9194 }.onFailure { exception ->
92- exception.message?. let { Logger .e(it) }
95+ Logger .e( exception.message ? : " Login failed " )
9396 analyticsHelper.logEvent(EVENT_ERROR_LOGIN )
94- sideEffect = exception.message?.let {
95- LoginSideEffect .ShowToast (it)
96- }
97+ postErrorDialog(
98+ errorScope = ErrorScope .LOGIN ,
99+ exception = exception,
100+ )
97101 }
98102 } finally {
99103 isLoading = false
0 commit comments