From 0b250ed949a53c96f02bd690c9b4460fc86ad028 Mon Sep 17 00:00:00 2001 From: KwakEuiJin Date: Tue, 18 Jun 2024 00:07:45 +0900 Subject: [PATCH] =?UTF-8?q?[fix]:=20=EC=98=A4=EB=A5=98=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 --- .../core/viewmodel/MainViewModel.kt | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/core/viewmodel/main/src/main/java/com/hmh/hamyeonham/core/viewmodel/MainViewModel.kt b/core/viewmodel/main/src/main/java/com/hmh/hamyeonham/core/viewmodel/MainViewModel.kt index 500fb408..c988a682 100644 --- a/core/viewmodel/main/src/main/java/com/hmh/hamyeonham/core/viewmodel/MainViewModel.kt +++ b/core/viewmodel/main/src/main/java/com/hmh/hamyeonham/core/viewmodel/MainViewModel.kt @@ -73,26 +73,26 @@ class MainViewModel @Inject constructor( fun updateDailyChallengeFailed() { viewModelScope.launch { - setIsUnLockUseCase(true).onSuccess { - pointRepository.usePoint().onSuccess { + pointRepository.usePoint().onSuccess { + setIsUnLockUseCase(true).onSuccess { getChallengeStatus() sendEffect(MainEffect.SuccessUsePoint) }.onFailure { - if (it is HttpException) { - when (it.code()) { - LACK_POINT_ERROR_CODE -> { - sendEffect(MainEffect.LackOfPoint) - } - - else -> sendEffect(MainEffect.NetworkError) + Log.e("setIsUnLock error", it.toString()) + sendEffect(MainEffect.NetworkError) + } + }.onFailure { + if (it is HttpException) { + when (it.code()) { + LACK_POINT_ERROR_CODE -> { + sendEffect(MainEffect.LackOfPoint) } - } else { - sendEffect(MainEffect.NetworkError) + + else -> sendEffect(MainEffect.NetworkError) } + } else { + sendEffect(MainEffect.NetworkError) } - }.onFailure { - Log.e("setIsUnLock error", it.toString()) - sendEffect(MainEffect.NetworkError) } } }