Skip to content

Commit fd6b086

Browse files
committed
[IDLE-000] CenterPending 화면에서 CenterStatus를 2초마다 Polling 하도록 변경 및 HandlerHelper -> Helper 네이밍 변경
1 parent e370e07 commit fd6b086

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

app/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
namespace = "com.idle.care"
1212

1313
defaultConfig {
14-
versionCode = 17
15-
versionName = "1.2.2"
14+
versionCode = 18
15+
versionName = "1.2.3"
1616
targetSdk = 34
1717

1818
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

feature/center/pending/src/main/java/com/idle/pending/CenterPendingViewModel.kt

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ import androidx.lifecycle.viewModelScope
55
import com.idle.binding.EventHelper
66
import com.idle.binding.MainEvent
77
import com.idle.binding.ToastType.SUCCESS
8+
import com.idle.center.pending.R
89
import com.idle.domain.model.error.ErrorHelper
910
import com.idle.domain.model.profile.CenterManagerAccountStatus
1011
import com.idle.domain.usecase.auth.LogoutCenterUseCase
1112
import com.idle.domain.usecase.auth.SendCenterVerificationRequestUseCase
1213
import com.idle.domain.usecase.profile.GetCenterStatusUseCase
14+
import com.idle.navigation.DeepLinkDestination
15+
import com.idle.navigation.NavigationEvent
1316
import dagger.hilt.android.lifecycle.HiltViewModel
1417
import kotlinx.coroutines.delay
1518
import 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

Comments
 (0)