mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +01:00
Minor cleanup
This commit is contained in:
parent
fadaefeaef
commit
cb9c5a35cb
@ -105,7 +105,7 @@ class ReaderPresenter(
|
|||||||
|
|
||||||
val chaptersForReader = when {
|
val chaptersForReader = when {
|
||||||
(preferences.skipRead() || preferences.skipFiltered()) -> {
|
(preferences.skipRead() || preferences.skipFiltered()) -> {
|
||||||
val list = dbChapters.filterNot {
|
val filteredChapters = dbChapters.filterNot {
|
||||||
when {
|
when {
|
||||||
preferences.skipRead() && it.read -> true
|
preferences.skipRead() && it.read -> true
|
||||||
preferences.skipFiltered() -> {
|
preferences.skipFiltered() -> {
|
||||||
@ -119,13 +119,12 @@ class ReaderPresenter(
|
|||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.toMutableList()
|
|
||||||
|
|
||||||
val find = list.find { it.id == chapterId }
|
if (filteredChapters.any { it.id == chapterId }) {
|
||||||
if (find == null) {
|
filteredChapters
|
||||||
list.add(selectedChapter)
|
} else {
|
||||||
|
filteredChapters + listOf(selectedChapter)
|
||||||
}
|
}
|
||||||
list
|
|
||||||
}
|
}
|
||||||
else -> dbChapters
|
else -> dbChapters
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user