Skip to content

Commit

Permalink
Another update read fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Sep 10, 2023
1 parent e778358 commit c63ea7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions iosApp/Source/Home/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct HomeContent: View {

Button(
action: {
proxy.scrollTo(feedState.first?.id)
onForceRefreshClick()
},
label: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit c63ea7e

Please sign in to comment.