@@ -5,11 +5,14 @@ import androidx.lifecycle.viewModelScope
55import com.idle.binding.EventHelper
66import com.idle.binding.MainEvent
77import com.idle.binding.ToastType.SUCCESS
8+ import com.idle.center.pending.R
89import com.idle.domain.model.error.ErrorHelper
910import com.idle.domain.model.profile.CenterManagerAccountStatus
1011import com.idle.domain.usecase.auth.LogoutCenterUseCase
1112import com.idle.domain.usecase.auth.SendCenterVerificationRequestUseCase
1213import com.idle.domain.usecase.profile.GetCenterStatusUseCase
14+ import com.idle.navigation.DeepLinkDestination
15+ import com.idle.navigation.NavigationEvent
1316import dagger.hilt.android.lifecycle.HiltViewModel
1417import kotlinx.coroutines.delay
1518import kotlinx.coroutines.flow.MutableStateFlow
@@ -32,7 +35,7 @@ class CenterPendingViewModel @Inject constructor(
3235
3336 private var pollingJob = MutableStateFlow (false )
3437
35- init {
38+ init {
3639 subscribeCenterStatus()
3740 }
3841
@@ -43,7 +46,7 @@ class CenterPendingViewModel @Inject constructor(
4346 internal fun logout () = viewModelScope.launch {
4447 logoutCenterUseCase().onSuccess {
4548 navigationHelper.navigateTo(
46- com.idle.navigation. NavigationEvent .NavigateToAuthWithClearBackStack (
49+ NavigationEvent .NavigateToAuthWithClearBackStack (
4750 toastMsg = " 로그아웃이 완료되었습니다." ,
4851 toastType = " SUCCESS"
4952 )
@@ -73,7 +76,14 @@ class CenterPendingViewModel @Inject constructor(
7376 when (it.centerManagerAccountStatus) {
7477 CenterManagerAccountStatus .APPROVED -> {
7578 pollingJob.emit(false )
79+ navigationHelper.navigateTo(
80+ NavigationEvent .NavigateTo (
81+ destination = DeepLinkDestination .CenterHome ,
82+ popUpTo = R .id.centerPendingFragment,
83+ )
84+ )
7685
86+ eventHelper.sendEvent(MainEvent .ShowToast (" 센터 인증이 완료되었습니다." , SUCCESS ))
7787 }
7888
7989 else -> Unit
0 commit comments