From 0527dd4a096457e3c234804098f9ca147ce8ff64 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Thu, 21 Nov 2024 17:21:22 +0900 Subject: [PATCH] =?UTF-8?q?[IDLE-000]=20CenterPending=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20CenterStatus=EB=A5=BC=202=EC=B4=88?= =?UTF-8?q?=EB=A7=88=EB=8B=A4=20Polling=20=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20HandlerHelper=20->=20Helper=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 4 ++-- .../com/idle/pending/CenterPendingViewModel.kt | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a4154fc4..702639bd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,8 +11,8 @@ android { namespace = "com.idle.care" defaultConfig { - versionCode = 17 - versionName = "1.2.2" + versionCode = 18 + versionName = "1.2.3" targetSdk = 34 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/feature/center/pending/src/main/java/com/idle/pending/CenterPendingViewModel.kt b/feature/center/pending/src/main/java/com/idle/pending/CenterPendingViewModel.kt index 8fffa30a..9ba6ee08 100644 --- a/feature/center/pending/src/main/java/com/idle/pending/CenterPendingViewModel.kt +++ b/feature/center/pending/src/main/java/com/idle/pending/CenterPendingViewModel.kt @@ -5,11 +5,14 @@ import androidx.lifecycle.viewModelScope import com.idle.binding.EventHelper import com.idle.binding.MainEvent import com.idle.binding.ToastType.SUCCESS +import com.idle.center.pending.R import com.idle.domain.model.error.ErrorHelper import com.idle.domain.model.profile.CenterManagerAccountStatus import com.idle.domain.usecase.auth.LogoutCenterUseCase import com.idle.domain.usecase.auth.SendCenterVerificationRequestUseCase import com.idle.domain.usecase.profile.GetCenterStatusUseCase +import com.idle.navigation.DeepLinkDestination +import com.idle.navigation.NavigationEvent import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow @@ -32,7 +35,7 @@ class CenterPendingViewModel @Inject constructor( private var pollingJob = MutableStateFlow(false) - init{ + init { subscribeCenterStatus() } @@ -43,7 +46,7 @@ class CenterPendingViewModel @Inject constructor( internal fun logout() = viewModelScope.launch { logoutCenterUseCase().onSuccess { navigationHelper.navigateTo( - com.idle.navigation.NavigationEvent.NavigateToAuthWithClearBackStack( + NavigationEvent.NavigateToAuthWithClearBackStack( toastMsg = "로그아웃이 완료되었습니다.", toastType = "SUCCESS" ) @@ -73,7 +76,14 @@ class CenterPendingViewModel @Inject constructor( when (it.centerManagerAccountStatus) { CenterManagerAccountStatus.APPROVED -> { pollingJob.emit(false) + navigationHelper.navigateTo( + NavigationEvent.NavigateTo( + destination = DeepLinkDestination.CenterHome, + popUpTo = R.id.centerPendingFragment, + ) + ) + eventHelper.sendEvent(MainEvent.ShowToast("센터 인증이 완료되었습니다.", SUCCESS)) } else -> Unit