mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 12:48:42 +01:00
fix: explore results (#97)
This commit is contained in:
parent
1be69ea288
commit
618335e8f0
@ -220,18 +220,21 @@ class ExploreViewModel(
|
||||
listingType = listingType,
|
||||
sortType = sortType,
|
||||
)
|
||||
currentPage++
|
||||
if (!itemList.isNullOrEmpty()) {
|
||||
currentPage++
|
||||
}
|
||||
val itemsToAdd = itemList.orEmpty().filter { item ->
|
||||
if (settings.includeNsfw) {
|
||||
true
|
||||
} else {
|
||||
isSafeForWork(item)
|
||||
}
|
||||
}
|
||||
mvi.updateState {
|
||||
val newItems = if (refreshing) {
|
||||
itemList.orEmpty()
|
||||
itemsToAdd
|
||||
} else {
|
||||
it.results + itemList.orEmpty()
|
||||
}.filter { item ->
|
||||
if (settings.includeNsfw) {
|
||||
true
|
||||
} else {
|
||||
isSafeForWork(item)
|
||||
}
|
||||
it.results + itemsToAdd
|
||||
}
|
||||
it.copy(
|
||||
results = newItems,
|
||||
|
Loading…
x
Reference in New Issue
Block a user