diff --git a/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt b/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt index a90251de..17e63d05 100644 --- a/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt +++ b/feature/splash/src/main/java/team/ppac/splash/SplashActivity.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import androidx.core.view.WindowCompat import dagger.hilt.android.AndroidEntryPoint +import team.ppac.common.android.extension.forceKillApplication import team.ppac.designsystem.FarmemeTheme import team.ppac.navigator.MainNavigator import team.ppac.splash.mvi.SplashIntent @@ -46,6 +47,10 @@ class SplashActivity : ComponentActivity() { withFinish = true ) } + + SplashSideEffect.ForceFinish -> { + this@SplashActivity.forceKillApplication() + } } } } diff --git a/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt b/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt index 77b1d2e8..6044e284 100644 --- a/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt +++ b/feature/splash/src/main/java/team/ppac/splash/SplashViewModel.kt @@ -49,9 +49,8 @@ class SplashViewModel @Inject constructor( override suspend fun handleIntent(intent: SplashIntent) { when (intent) { SplashIntent.ClickDialogConfirm -> { - reduce { - copy(isNetworkError = false) - } + reduce { copy(isNetworkError = false) } + postSideEffect(SplashSideEffect.ForceFinish) } } } diff --git a/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt b/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt index aad6afc6..9a764d86 100644 --- a/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt +++ b/feature/splash/src/main/java/team/ppac/splash/mvi/SplashSideEffect.kt @@ -4,4 +4,5 @@ import team.ppac.common.android.base.UiSideEffect sealed class SplashSideEffect : UiSideEffect { data object NavigateToMain : SplashSideEffect() + data object ForceFinish : SplashSideEffect() } \ No newline at end of file