Skip to content

Commit

Permalink
[fix]: 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kez-lab committed Jun 17, 2024
1 parent b4ac33b commit 0b250ed
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 0b250ed

Please sign in to comment.