DB caching. #33

Merged
AmineB merged 9 commits from feature/sqldelight into master 2022-08-23 20:39:20 +00:00
Showing only changes of commit d0d82751e2 - Show all commits

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() }
}
}