From a2678a1f840b734d6aae2d044984feaa5b96f06b Mon Sep 17 00:00:00 2001 From: dolchvita Date: Tue, 21 Jan 2025 16:49:09 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=80=EC=83=89=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/flab/deepsleep/ui/photo/PhotoViewModel.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/com/flab/deepsleep/ui/photo/PhotoViewModel.kt b/app/src/main/java/com/flab/deepsleep/ui/photo/PhotoViewModel.kt index 8400a32..fadca38 100644 --- a/app/src/main/java/com/flab/deepsleep/ui/photo/PhotoViewModel.kt +++ b/app/src/main/java/com/flab/deepsleep/ui/photo/PhotoViewModel.kt @@ -53,6 +53,7 @@ class PhotoViewModel @Inject constructor( pagingSourceFactory = { PhotoPagingSource(photos) } ).flow } + .cachedIn(viewModelScope) // 여기 .combine(savedPhotos) { pagingData, savedPhotos -> pagingData.map { photo -> val savedPhoto = savedPhotos.find { it.id == photo.id } @@ -63,8 +64,6 @@ class PhotoViewModel @Inject constructor( } } } - .cachedIn(viewModelScope) - /* Bookmark */ private val _isLiked = MutableLiveData() @@ -109,7 +108,6 @@ class PhotoViewModel @Inject constructor( }?.awaitAll()?.filterNotNull() ?: emptyList() } catch (e: Exception) { e.printStackTrace() - emptyList() } }