mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-18 00:59:42 +02:00
Add option to hide missing chapter count (#2108)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@@ -256,6 +256,10 @@ object SettingsLibraryScreen : SearchableSettings {
|
||||
),
|
||||
title = stringResource(MR.strings.pref_mark_duplicate_read_chapter_read),
|
||||
),
|
||||
Preference.PreferenceItem.SwitchPreference(
|
||||
preference = libraryPreferences.hideMissingChapters(),
|
||||
title = stringResource(MR.strings.pref_hide_missing_chapter_indicators),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
@@ -230,6 +230,7 @@ class MangaScreenModel(
|
||||
excludedScanlators = getExcludedScanlators.await(mangaId),
|
||||
isRefreshingData = needRefreshInfo || needRefreshChapter,
|
||||
dialog = null,
|
||||
hideMissingChapters = libraryPreferences.hideMissingChapters().get(),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1126,6 +1127,7 @@ class MangaScreenModel(
|
||||
val isRefreshingData: Boolean = false,
|
||||
val dialog: Dialog? = null,
|
||||
val hasPromptedToAddBefore: Boolean = false,
|
||||
val hideMissingChapters: Boolean = false,
|
||||
) : State {
|
||||
val processedChapters by lazy {
|
||||
chapters.applyFilters(manga).toList()
|
||||
@@ -1136,6 +1138,10 @@ class MangaScreenModel(
|
||||
}
|
||||
|
||||
val chapterListItems by lazy {
|
||||
if (hideMissingChapters) {
|
||||
return@lazy processedChapters
|
||||
}
|
||||
|
||||
processedChapters.insertSeparators { before, after ->
|
||||
val (lowerChapter, higherChapter) = if (manga.sortDescending()) {
|
||||
after to before
|
||||
|
Reference in New Issue
Block a user