Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX/#161] Home 화면에서 종료 구현 #163

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading