Skip to content

Commit

Permalink
[FIX/#99] Splash 뷰 intentFlag 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchbreeze committed Aug 1, 2024
1 parent 677d85a commit be7e63f
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,23 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(R.layout.activity_spl
viewModel.reissueTokenResult.flowWithLifecycle(lifecycle).distinctUntilChanged()
.onEach { isSuccess ->
if (isSuccess) {
Intent(this, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(this)
}
navigateToMainView()
} else {
navigateToLoginView()
}
}.launchIn(lifecycleScope)
}

private fun navigateToMainView() {
Intent(this, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
startActivity(this)
}
}

private fun navigateToLoginView() {
Intent(this, LoginActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
startActivity(
this,
ActivityOptions.makeCustomAnimation(
Expand Down

0 comments on commit be7e63f

Please sign in to comment.