From 80bb03b165ab027f732c5754ec87d95e19b5872c Mon Sep 17 00:00:00 2001 From: ki960213 Date: Fri, 3 Nov 2023 22:22:02 +0900 Subject: [PATCH] =?UTF-8?q?refactor(ChildCommentViewModel):=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=A6=AC=ED=8C=A9=ED=84=B0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/childCommentList/ChildCommentViewModel.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/android/2023-emmsale/app/src/main/java/com/emmsale/presentation/ui/childCommentList/ChildCommentViewModel.kt b/android/2023-emmsale/app/src/main/java/com/emmsale/presentation/ui/childCommentList/ChildCommentViewModel.kt index 377645d34..ecc80b3a1 100644 --- a/android/2023-emmsale/app/src/main/java/com/emmsale/presentation/ui/childCommentList/ChildCommentViewModel.kt +++ b/android/2023-emmsale/app/src/main/java/com/emmsale/presentation/ui/childCommentList/ChildCommentViewModel.kt @@ -79,8 +79,7 @@ class ChildCommentViewModel @Inject constructor( is Success -> _comments.value = ChildCommentsUiState.create(uid, result.data) is Unexpected -> - _commonUiEvent.value = - CommonUiEvent.Unexpected(result.error.toString()) + _commonUiEvent.value = CommonUiEvent.Unexpected(result.error.toString()) } _screenUiState.value = ScreenUiState.NONE } @@ -99,8 +98,7 @@ class ChildCommentViewModel @Inject constructor( } is Unexpected -> - _commonUiEvent.value = - CommonUiEvent.Unexpected(result.error.toString()) + _commonUiEvent.value = CommonUiEvent.Unexpected(result.error.toString()) } loadingJob.cancel() _screenUiState.value = ScreenUiState.NONE @@ -121,8 +119,7 @@ class ChildCommentViewModel @Inject constructor( } is Unexpected -> - _commonUiEvent.value = - CommonUiEvent.Unexpected(result.error.toString()) + _commonUiEvent.value = CommonUiEvent.Unexpected(result.error.toString()) } loadingJob.cancel() _screenUiState.value = ScreenUiState.NONE @@ -138,8 +135,7 @@ class ChildCommentViewModel @Inject constructor( NetworkError -> _commonUiEvent.value = CommonUiEvent.RequestFailByNetworkError is Success -> refresh().join() is Unexpected -> - _commonUiEvent.value = - CommonUiEvent.Unexpected(result.error.toString()) + _commonUiEvent.value = CommonUiEvent.Unexpected(result.error.toString()) } loadingJob.cancel() _screenUiState.value = ScreenUiState.NONE @@ -184,8 +180,7 @@ class ChildCommentViewModel @Inject constructor( is Success -> _comments.value = ChildCommentsUiState.create(uid, result.data) is Unexpected -> - _commonUiEvent.value = - CommonUiEvent.Unexpected(result.error.toString()) + _commonUiEvent.value = CommonUiEvent.Unexpected(result.error.toString()) } _screenUiState.value = ScreenUiState.NONE }