From f5dae2cce89a37d5356570c8b88a6507da69b8d3 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 25 Apr 2024 16:40:49 +0530 Subject: [PATCH] Fix home screen not updating when posts type filter is changed --- .../sasikanth/rss/reader/home/HomePresenter.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt index 8697b891a..734ede37a 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt @@ -264,16 +264,16 @@ class HomePresenter( } } - rssRepository.featuredPosts( - selectedFeedId = activeSource?.id, - unreadOnly = unreadOnly, - after = postsAfter - ) + rssRepository + .featuredPosts( + selectedFeedId = activeSource?.id, + unreadOnly = unreadOnly, + after = postsAfter + ) + .map { featuredPosts -> Triple(activeSource, postsType, featuredPosts) } } .distinctUntilChanged() - .onEach { featuredPosts -> - val postsType = _state.value.postsType - val activeSource = _state.value.activeSource + .onEach { (activeSource, postsType, featuredPosts) -> val featuredPostIds = featuredPosts.map { it.id } val unreadOnly =