diff --git a/iosApp/Source/Home/HomeScreen.swift b/iosApp/Source/Home/HomeScreen.swift index 275e7fec..6f075703 100644 --- a/iosApp/Source/Home/HomeScreen.swift +++ b/iosApp/Source/Home/HomeScreen.swift @@ -206,6 +206,7 @@ struct HomeContent: View { Button( action: { + proxy.scrollTo(feedState.first?.id) onForceRefreshClick() }, label: { diff --git a/shared/src/commonMain/kotlin/com/prof18/feedflow/domain/feed/retriever/FeedRetrieverRepositoryImpl.kt b/shared/src/commonMain/kotlin/com/prof18/feedflow/domain/feed/retriever/FeedRetrieverRepositoryImpl.kt index a0f0d5ac..17027679 100644 --- a/shared/src/commonMain/kotlin/com/prof18/feedflow/domain/feed/retriever/FeedRetrieverRepositoryImpl.kt +++ b/shared/src/commonMain/kotlin/com/prof18/feedflow/domain/feed/retriever/FeedRetrieverRepositoryImpl.kt @@ -183,8 +183,13 @@ internal class FeedRetrieverRepositoryImpl( databaseHelper.insertFeedItems(items, dateFormatter.currentTimeMillis()) mutableFeedState.update { oldItems -> - (oldItems.toMutableList() + items) + oldItems .asSequence() + .plus( + oldItems.filterNot { item -> + items.any { it.id == item.id } + } + ) .filter { !it.isRead } .distinctBy { it.id } .sortedByDescending { it.pubDateMillis }