Show updates and upcoming filter icon as active for categories (#3772)

This commit is contained in:
Secozzi
2026-08-15 17:19:05 +02:00
committed by GitHub
parent ed30766a9f
commit abdecb3cb4
3 changed files with 23 additions and 2 deletions
@@ -115,7 +115,13 @@ class UpdatesViewModel(
prefs.filterStarted,
prefs.filterBookmarked,
)
.any { it != TriState.DISABLED }
.any { it != TriState.DISABLED } ||
prefs.filterExcludedScanlators ||
listOf(
prefs.filterIncludedCategories,
prefs.filterExcludedCategories,
)
.any { it.isNotEmpty() }
}
.distinctUntilChanged()
@@ -53,6 +53,16 @@ class UpcomingViewModel(
private val dialog = MutableStateFlow<Dialog?>(null)
private val hasActiveFilters = getUpcomingItemPreferenceFlow()
.map { prefs ->
listOf(
prefs.filterIncludedCategories,
prefs.filterExcludedCategories,
)
.any { it.isNotEmpty() }
}
.distinctUntilChanged()
private val upcoming = getUpcomingItemPreferenceFlow()
.distinctUntilChanged()
.flatMapLatest {
@@ -70,12 +80,14 @@ class UpcomingViewModel(
upcoming,
selectedYearMonth,
dialog,
) { upcoming, selectedYearMonth, dialog ->
hasActiveFilters,
) { upcoming, selectedYearMonth, dialog, hasActiveFilters ->
State(
selectedYearMonth = selectedYearMonth,
items = upcoming,
events = upcoming.toEvents(),
headerIndexes = upcoming.getHeaderIndexes(),
hasActiveFilters = hasActiveFilters,
dialog = dialog,
)
}