From 9e9c662e0d854d79c6d3ee35c5b6750969e74515 Mon Sep 17 00:00:00 2001 From: vrexpert Date: Wed, 3 Apr 2024 17:45:44 +0900 Subject: [PATCH] =?UTF-8?q?refactor(ArtistDetailViewModel):=20=EC=95=84?= =?UTF-8?q?=ED=8B=B0=EC=8A=A4=ED=8A=B8=20=EC=83=81=EC=84=B8=20=EB=B9=84?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=20=ED=98=B8=EC=B6=9C=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/artistdetail/ArtistDetailViewModel.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/artistdetail/ArtistDetailViewModel.kt b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/artistdetail/ArtistDetailViewModel.kt index 2ff4132cc..0b33d2a78 100644 --- a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/artistdetail/ArtistDetailViewModel.kt +++ b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/artistdetail/ArtistDetailViewModel.kt @@ -34,13 +34,11 @@ class ArtistDetailViewModel @Inject constructor( viewModelScope.launch { runCatching { - val deferredArtistDetail = - async { artistRepository.loadArtistDetail(id).getOrThrow() } - val deferredFestivals = - async { artistRepository.loadArtistFestivals(id, 10).getOrThrow().toUiState() } + val deferredArtistDetail = async { artistRepository.loadArtistDetail(id) } + val deferredFestivals = async { artistRepository.loadArtistFestivals(id, 10) } _uiState.value = ArtistDetailUiState.Success( - deferredArtistDetail.await(), - deferredFestivals.await(), + deferredArtistDetail.await().getOrThrow(), + deferredFestivals.await().getOrThrow().toUiState(), ) }.onFailure { _uiState.value = ArtistDetailUiState.Error