Skip to content

Commit

Permalink
refactor(ChildCommentViewModel): 코드 리팩터링
Browse files Browse the repository at this point in the history
  • Loading branch information
ki960213 committed Nov 3, 2023
1 parent e2eab6c commit 80bb03b
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 80bb03b

Please sign in to comment.