Skip to content

Commit

Permalink
#128 / Home 조회에서 UE1006 발생 시 액션
Browse files Browse the repository at this point in the history
  • Loading branch information
taeheeL committed Dec 7, 2023
1 parent aff5335 commit 1150f19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/main/java/sopt/uni/presentation/home/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import sopt.uni.databinding.ActivityHomeBinding
import sopt.uni.presentation.common.content.ErrorCodeState
import sopt.uni.presentation.common.content.UNDECIDED
import sopt.uni.presentation.history.HistoryActivity
import sopt.uni.presentation.invite.NickNameActivity
import sopt.uni.presentation.login.LoginActivity
import sopt.uni.presentation.mypage.MypageSettingActivity
import sopt.uni.presentation.shortgame.createshortgame.CreateShortGameActivity
Expand Down Expand Up @@ -132,11 +133,17 @@ class HomeActivity : BindingActivity<ActivityHomeBinding>(R.layout.activity_home
homeViewModel.errorState.collect {
when (it) {
is ErrorCodeState.NoToken -> {
showToast("존재하지 않는 사용자입니다. 다시 로그인해주세요")
showToast(getString(R.string.ue1008_error_message))
startActivity<LoginActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
}

is ErrorCodeState.NoPartner -> {
showToast(getString(R.string.ue1006_error_message))
startActivity<NickNameActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
}

else -> {
Timber.e("error: $it")
}
Expand Down

0 comments on commit 1150f19

Please sign in to comment.