Filtering DB items.

This commit is contained in:
aminecmi 2022-08-23 20:34:20 +02:00
parent 3b8f4991e9
commit d0d82751e2

View File

@ -64,7 +64,11 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails
)
} else {
if (itemsCaching) {
fetchedItems = getDBItems().map { it.toView() }
fetchedItems = getDBItems().filter {
displayedItems == ItemType.ALL ||
(it.unread && displayedItems == ItemType.UNREAD) ||
(it.starred && displayedItems == ItemType.STARRED)
}.map { it.toView() }
}
}