From 86a2cdfe031a7dc18c18d646212ef06f571817fb Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 25 Apr 2024 16:57:03 +0530 Subject: [PATCH] Use custom equivalent check for home screen posts list --- .../kotlin/dev/sasikanth/rss/reader/home/HomePresenter.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 734ede37a..37d8a25aa 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 @@ -272,7 +272,11 @@ class HomePresenter( ) .map { featuredPosts -> Triple(activeSource, postsType, featuredPosts) } } - .distinctUntilChanged() + .distinctUntilChanged { old, new -> + old.third.map { it.id } == new.third.map { it.id } || + old.first == new.first || + old.second == new.second + } .onEach { (activeSource, postsType, featuredPosts) -> val featuredPostIds = featuredPosts.map { it.id }