Minor cleanup
(cherry picked from commit cb9c5a35cb3065bb2c153951861d72c9639d57b3)
This commit is contained in:
parent
e202c108ff
commit
f4d1f5ff95
@ -136,7 +136,7 @@ class ReaderPresenter(
|
||||
|
||||
val chaptersForReader = when {
|
||||
(preferences.skipRead() || preferences.skipFiltered()) -> {
|
||||
val list = dbChapters.filterNot {
|
||||
val filteredChapters = dbChapters.filterNot {
|
||||
when {
|
||||
preferences.skipRead() && it.read -> true
|
||||
preferences.skipFiltered() -> {
|
||||
@ -152,13 +152,12 @@ class ReaderPresenter(
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
.toMutableList()
|
||||
|
||||
val find = list.find { it.id == chapterId }
|
||||
if (find == null) {
|
||||
list.add(selectedChapter)
|
||||
if (filteredChapters.any { it.id == chapterId }) {
|
||||
filteredChapters
|
||||
} else {
|
||||
filteredChapters + listOf(selectedChapter)
|
||||
}
|
||||
list
|
||||
}
|
||||
else -> dbChapters
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user