Skip to content

Commit

Permalink
[FIX/#151] Home 화면에서 종료 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
boiledEgg-s committed Jul 19, 2024
1 parent cf1cf91 commit fc3a500
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.flowWithLifecycle
import androidx.navigation.NavController
import androidx.navigation.NavOptions
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.terning.core.designsystem.component.image.TerningImage
import com.terning.core.designsystem.theme.TerningMain
import com.terning.feature.R
import com.terning.feature.home.home.navigation.navigateHome
import com.terning.feature.onboarding.signin.navigation.navigateSignIn
import com.terning.feature.onboarding.splash.navigation.Splash

@Composable
fun SplashScreen(
Expand Down Expand Up @@ -45,12 +47,17 @@ fun SplashScreen(
.collect { sideEffect ->
when (sideEffect) {
is SplashState.GetHasAccessToken -> {
if (sideEffect.hasAccessToken) navController.navigateHome()
if (sideEffect.hasAccessToken) navController.navigateHome(
navOptions = NavOptions.Builder().setPopUpTo(
route = Splash,
inclusive = true
).build()
)
else navController.navigateSignIn()
}

}
}

}

Column(
Expand Down

0 comments on commit fc3a500

Please sign in to comment.