From cace6cea467df121ac5a3db98e8a61f1fc08bc1b Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:31:22 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[FEATURE]#223=20:=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=ED=83=88=ED=87=B4=20API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wespot/data/remote/source/auth/AuthDataSource.kt | 1 + .../data/remote/source/auth/AuthDataSourceImpl.kt | 10 +++++++++- .../wespot/data/repository/auth/AuthRepositoryImpl.kt | 4 +++- .../wespot/domain/repository/auth/AuthRepository.kt | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSource.kt b/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSource.kt index ddbbea94..d0362f7e 100644 --- a/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSource.kt +++ b/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSource.kt @@ -11,4 +11,5 @@ interface AuthDataSource { suspend fun signIn(signIn: SignInDto): Result suspend fun signUp(signUp: SignUpDto): Result suspend fun revoke(revokeReasonList: RevokeReasonListDto): Result + suspend fun signOut(): Result } diff --git a/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSourceImpl.kt b/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSourceImpl.kt index 7accefbb..f5c4e7d5 100644 --- a/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSourceImpl.kt +++ b/data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/auth/AuthDataSourceImpl.kt @@ -60,4 +60,12 @@ class AuthDataSourceImpl @Inject constructor( } setBody(revokeReasonList) } -} \ No newline at end of file + + override suspend fun signOut(): Result = + httpClient.safeRequest { + url { + method = HttpMethod.Patch + path("api/v1/auth/logout") + } + } +} diff --git a/data/src/main/kotlin/com/bff/wespot/data/repository/auth/AuthRepositoryImpl.kt b/data/src/main/kotlin/com/bff/wespot/data/repository/auth/AuthRepositoryImpl.kt index ca87adf2..04460b61 100644 --- a/data/src/main/kotlin/com/bff/wespot/data/repository/auth/AuthRepositoryImpl.kt +++ b/data/src/main/kotlin/com/bff/wespot/data/repository/auth/AuthRepositoryImpl.kt @@ -61,4 +61,6 @@ class AuthRepositoryImpl @Inject constructor( RevokeReasonListDto(revokeReasons = revokeReasonList) ) } -} \ No newline at end of file + + override suspend fun signOut(): Result = authDataSource.signOut() +} diff --git a/domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/AuthRepository.kt b/domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/AuthRepository.kt index edfb1fe1..4d836d75 100644 --- a/domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/AuthRepository.kt +++ b/domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/AuthRepository.kt @@ -7,4 +7,5 @@ interface AuthRepository { suspend fun signIn(signIn: SignIn): Result suspend fun signUp(signUp: SignUp): Boolean suspend fun revoke(revokeReasonList: List): Result + suspend fun signOut(): Result } From 37801b68082de91b8644b3471869a23901c1af8c Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:31:43 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[FEATURE]#223=20:=20=EC=B9=B4=EC=B9=B4?= =?UTF-8?q?=EC=98=A4=ED=86=A1=20=ED=9A=8C=EC=9B=90=20=ED=83=88=ED=87=B4=20?= =?UTF-8?q?API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bff/wespot/ui/util/KakaoLoginManager.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/ui/src/main/kotlin/com/bff/wespot/ui/util/KakaoLoginManager.kt b/core/ui/src/main/kotlin/com/bff/wespot/ui/util/KakaoLoginManager.kt index c84ebb92..492f867d 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/ui/util/KakaoLoginManager.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/ui/util/KakaoLoginManager.kt @@ -85,9 +85,17 @@ class KakaoLoginManager { companion object { fun logout() = UserApiClient.instance.logout { error -> if (error != null) { - Timber.d("로그아웃 실패. SDK에서 토큰 삭제됨") + Timber.e("Kakao 로그아웃 실패. SDK에서 토큰 삭제됨 : $error") } else { - Timber.d("로그아웃 성공. SDK에서 토큰 삭제됨") + Timber.d("Kakao 로그아웃 성공. SDK에서 토큰 삭제됨") + } + } + + fun revoke() = UserApiClient.instance.unlink { error -> + if (error != null) { + Timber.e("Kakao 탈퇴 실패 : $error") + } else { + Timber.d("Kakao 탈퇴 성공. SDK에서 토큰 삭제됨") } } } From 01309b753f35e628c492c4399a145ca83d5ef2db Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:38:01 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[FEATURE]#223=20:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EC=8B=9C,=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20API=20=ED=98=B8=EC=B6=9C=20=EC=84=B1=EA=B3=B5?= =?UTF-8?q?=ED=95=9C=20=EA=B2=BD=EC=9A=B0=EC=97=90=EB=A7=8C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20+?= =?UTF-8?q?=20=ED=9A=8C=EC=9B=90=ED=83=88=ED=87=B4=20API=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entire/viewmodel/EntireViewModel.kt | 57 ++++++++++++------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt index 4a8a2a13..a3ffaf66 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt @@ -51,8 +51,8 @@ class EntireViewModel @Inject constructor( EntireAction.OnRevokeScreenEntered -> observeProfileDataFlow() EntireAction.OnBlockListScreenEntered -> getBlockedMessageList() EntireAction.OnRevokeConfirmed -> handleRevokeConfirmed() - EntireAction.OnRevokeButtonClicked -> revokeUser() - EntireAction.OnSignOutButtonClicked -> signOut() + EntireAction.OnRevokeButtonClicked -> handleRevoke() + EntireAction.OnSignOutButtonClicked -> handleSignOut() EntireAction.UnBlockMessage -> unblockMessage() EntireAction.OnInputRevokeReasonSelected -> handleInputRevokeReasonSelected() is EntireAction.OnUnBlockButtonClicked -> handleUnBlockButtonClicked(action.messageId) @@ -93,34 +93,49 @@ class EntireViewModel @Inject constructor( reduce { state.copy(webLinkMap = webLinkMap) } } - private fun revokeUser() = intent { + private fun handleRevoke() = intent { + reduce { state.copy(isLoading = true) } val revokeReason = if (state.isInputRevokeReasonSelected) { state.revokeReasonList + state.inputRevokeReason } else { state.revokeReasonList } - viewModelScope.launch { - launch { - authRepository.revoke(revokeReason) - .onSuccess { - clearCachedData() - postSideEffect(EntireSideEffect.NavigateToAuth) - } - .onNetworkFailure { - postSideEffect(it.toSideEffect()) - } - .onFailure { - Timber.e(it) - } - } + viewModelScope.launch(coroutineDispatcher) { + authRepository.revoke(revokeReason) + .onSuccess { + KakaoLoginManager.revoke() + clearCachedData() + postSideEffect(EntireSideEffect.NavigateToAuth) + } + .onNetworkFailure { + postSideEffect(it.toSideEffect()) + } + .onFailure { + reduce { state.copy(isLoading = false) } + Timber.e(it) + } } } - private fun signOut() = intent { - clearCachedData() - KakaoLoginManager.logout() - postSideEffect(EntireSideEffect.NavigateToAuth) + private fun handleSignOut() = intent { + reduce { state.copy(isLoading = true) } + + viewModelScope.launch(coroutineDispatcher) { + authRepository.signOut() + .onSuccess { + KakaoLoginManager.logout() + clearCachedData() + postSideEffect(EntireSideEffect.NavigateToAuth) + } + .onNetworkFailure { + postSideEffect(it.toSideEffect()) + } + .onFailure { + reduce { state.copy(isLoading = false) } + Timber.e(it) + } + } } private fun clearCachedData() { From 20abdaf2c138ffae4451bcfa7f87df0d39f82172 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:38:15 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[FEATURE]#223=20:=20=EB=A1=9C=EB=94=A9=20?= =?UTF-8?q?=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4=EC=85=98=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wespot/entire/screen/setting/AccountSettingScreen.kt | 8 +++++++- .../wespot/entire/screen/setting/RevokeConfirmScreen.kt | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt index df69c788..1236ccbf 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt @@ -27,7 +27,9 @@ import com.bff.wespot.entire.state.EntireAction import com.bff.wespot.entire.state.EntireSideEffect import com.bff.wespot.entire.viewmodel.EntireViewModel import com.bff.wespot.navigation.Navigator +import com.bff.wespot.ui.component.LoadingAnimation import com.ramcosta.composedestinations.annotation.Destination +import org.orbitmvi.orbit.compose.collectAsState import org.orbitmvi.orbit.compose.collectSideEffect interface AccountSettingNavigator { @@ -47,6 +49,7 @@ fun AccountSettingScreen( var showDialog by remember { mutableStateOf(false) } val action = viewModel::onAction + val state by viewModel.collectAsState() viewModel.collectSideEffect { when (it) { @@ -54,7 +57,6 @@ fun AccountSettingScreen( val intent = activityNavigator.navigateToAuth(context) context.startActivity(intent) } - else -> {} } } @@ -94,6 +96,10 @@ fun AccountSettingScreen( onDismissRequest = { }, ) } + + if (state.isLoading) { + LoadingAnimation() + } } @Composable diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt index 3b0b99e3..6d435cd9 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt @@ -37,6 +37,7 @@ import com.bff.wespot.entire.viewmodel.EntireViewModel import com.bff.wespot.navigation.Navigator import com.bff.wespot.navigation.util.EXTRA_TOAST_MESSAGE import com.bff.wespot.ui.component.BottomButtonLayout +import com.bff.wespot.ui.component.LoadingAnimation import com.bff.wespot.ui.component.WSBottomSheet import com.bff.wespot.ui.component.WSSelectionItem import com.bff.wespot.ui.util.handleSideEffect @@ -170,6 +171,10 @@ fun RevokeConfirmScreen( onDismissRequest = { }, ) } + + if (state.isLoading) { + LoadingAnimation() + } } @Composable From edebb01640b0e25cf7680bf81c721f8e8c5b883c Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:40:21 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[FEATURE]#223=20:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EC=8B=9C,=20BaseSideEffect=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bff/wespot/entire/screen/setting/AccountSettingScreen.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt index 1236ccbf..ef2ea438 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt @@ -28,6 +28,7 @@ import com.bff.wespot.entire.state.EntireSideEffect import com.bff.wespot.entire.viewmodel.EntireViewModel import com.bff.wespot.navigation.Navigator import com.bff.wespot.ui.component.LoadingAnimation +import com.bff.wespot.ui.util.handleSideEffect import com.ramcosta.composedestinations.annotation.Destination import org.orbitmvi.orbit.compose.collectAsState import org.orbitmvi.orbit.compose.collectSideEffect @@ -51,6 +52,8 @@ fun AccountSettingScreen( val action = viewModel::onAction val state by viewModel.collectAsState() + handleSideEffect(viewModel.sideEffect) + viewModel.collectSideEffect { when (it) { is EntireSideEffect.NavigateToAuth -> { From 3c4f7c2190c4999e203b9be02c2ea4ab7a00ff07 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 12:41:52 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[FEATURE]#223=20:=20BaseSideEffect=20Channe?= =?UTF-8?q?l=20Buffered=20=EC=82=AC=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/ui/src/main/kotlin/com/bff/wespot/ui/base/BaseViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/src/main/kotlin/com/bff/wespot/ui/base/BaseViewModel.kt b/core/ui/src/main/kotlin/com/bff/wespot/ui/base/BaseViewModel.kt index 0448d824..a12d3714 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/ui/base/BaseViewModel.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/ui/base/BaseViewModel.kt @@ -18,7 +18,7 @@ open class BaseViewModel : ViewModel() { val networkState get() = networkStateChecker.networkState - private val _sideEffect = Channel() + private val _sideEffect = Channel(Channel.BUFFERED) val sideEffect = _sideEffect.receiveAsFlow() protected suspend fun postSideEffect(sideEffect: SideEffect) = _sideEffect.send(sideEffect) From f2fda360a62c1f21d43b41874af6d69c8367db56 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 13:00:18 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[FEATURE]#223=20:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=ED=83=88=ED=87=B4=20API=20=ED=98=B8=EC=B6=9C=20=EC=A0=84,=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EB=8B=AB=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bff/wespot/entire/screen/setting/AccountSettingScreen.kt | 3 +++ .../bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt | 1 + .../main/java/com/bff/wespot/entire/state/EntireSideEffect.kt | 1 + .../java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt | 1 + 4 files changed, 6 insertions(+) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt index ef2ea438..e2043776 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt @@ -60,6 +60,9 @@ fun AccountSettingScreen( val intent = activityNavigator.navigateToAuth(context) context.startActivity(intent) } + is EntireSideEffect.CloseSignOutDialog -> { + showDialog = false + } } } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt index 6d435cd9..d57a69d6 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt @@ -75,6 +75,7 @@ fun RevokeConfirmScreen( intent.putExtra(EXTRA_TOAST_MESSAGE, context.getString(R.string.revoke_done)) context.startActivity(intent) } + else -> { } } } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt b/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt index 073562ce..527143e4 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt @@ -2,4 +2,5 @@ package com.bff.wespot.entire.state sealed class EntireSideEffect { data object NavigateToAuth : EntireSideEffect() + data object CloseSignOutDialog : EntireSideEffect() } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt index a3ffaf66..adf010ec 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt @@ -119,6 +119,7 @@ class EntireViewModel @Inject constructor( } private fun handleSignOut() = intent { + postSideEffect(EntireSideEffect.CloseSignOutDialog) reduce { state.copy(isLoading = true) } viewModelScope.launch(coroutineDispatcher) { From 4acc81d2f98dbce4f584e09317a7737079a54482 Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 13:03:49 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[FEATURE]#223=20:=20=ED=9A=8C=EC=9B=90?= =?UTF-8?q?=ED=83=88=ED=87=B4=20API=20=ED=98=B8=EC=B6=9C=20=EC=A0=84,=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EB=8B=AB=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wespot/entire/screen/setting/AccountSettingScreen.kt | 1 + .../wespot/entire/screen/setting/RevokeConfirmScreen.kt | 7 ++++++- .../java/com/bff/wespot/entire/state/EntireSideEffect.kt | 1 + .../com/bff/wespot/entire/viewmodel/EntireViewModel.kt | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt index e2043776..263b0669 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/AccountSettingScreen.kt @@ -63,6 +63,7 @@ fun AccountSettingScreen( is EntireSideEffect.CloseSignOutDialog -> { showDialog = false } + is EntireSideEffect.CloseRevokeDialog -> { } } } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt index d57a69d6..e4a8ee09 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/screen/setting/RevokeConfirmScreen.kt @@ -75,7 +75,12 @@ fun RevokeConfirmScreen( intent.putExtra(EXTRA_TOAST_MESSAGE, context.getString(R.string.revoke_done)) context.startActivity(intent) } - else -> { } + + is EntireSideEffect.CloseRevokeDialog -> { + showDialog = false + } + + is EntireSideEffect.CloseSignOutDialog -> { } } } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt b/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt index 527143e4..f103b11d 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/state/EntireSideEffect.kt @@ -3,4 +3,5 @@ package com.bff.wespot.entire.state sealed class EntireSideEffect { data object NavigateToAuth : EntireSideEffect() data object CloseSignOutDialog : EntireSideEffect() + data object CloseRevokeDialog : EntireSideEffect() } diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt index adf010ec..a54fbad9 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt @@ -94,7 +94,9 @@ class EntireViewModel @Inject constructor( } private fun handleRevoke() = intent { + postSideEffect(EntireSideEffect.CloseRevokeDialog) reduce { state.copy(isLoading = true) } + val revokeReason = if (state.isInputRevokeReasonSelected) { state.revokeReasonList + state.inputRevokeReason } else { @@ -119,7 +121,6 @@ class EntireViewModel @Inject constructor( } private fun handleSignOut() = intent { - postSideEffect(EntireSideEffect.CloseSignOutDialog) reduce { state.copy(isLoading = true) } viewModelScope.launch(coroutineDispatcher) { From 0999b252e493b00c8117de88af07011679018d4d Mon Sep 17 00:00:00 2001 From: jeongjaino Date: Sun, 26 Jan 2025 13:05:36 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[FEATURE]#223=20:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20API=20=ED=98=B8=EC=B6=9C=20=EC=A0=84,=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EB=8B=AB=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt index a54fbad9..0d6ac8aa 100644 --- a/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt +++ b/feature/entire/src/main/java/com/bff/wespot/entire/viewmodel/EntireViewModel.kt @@ -121,6 +121,7 @@ class EntireViewModel @Inject constructor( } private fun handleSignOut() = intent { + postSideEffect(EntireSideEffect.CloseSignOutDialog) reduce { state.copy(isLoading = true) } viewModelScope.launch(coroutineDispatcher) {