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
+3
View File
@@ -11,6 +11,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
- `Other` - for technical stuff. - `Other` - for technical stuff.
## [Unreleased] ## [Unreleased]
### Improved
- Show updates and upcoming filter icon as active for categories ([@Secozzi](https://github.com/Secozzi)) ([#3772](https://github.com/mihonapp/mihon/pull/3772))
### Fixed ### Fixed
- Fixed app and extension update check running again on configuration change ([@AntsyLich](https://github.com/AntsyLich)) ([#3708](https://github.com/mihonapp/mihon/pull/3708)) - Fixed app and extension update check running again on configuration change ([@AntsyLich](https://github.com/AntsyLich)) ([#3708](https://github.com/mihonapp/mihon/pull/3708))
- Fixed MangaBaka user start/finish dates drifting in negative offset timezones ([@MajorTanya](https://github.com/MajorTanya)) ([#3711](https://github.com/mihonapp/mihon/pull/3711)) - Fixed MangaBaka user start/finish dates drifting in negative offset timezones ([@MajorTanya](https://github.com/MajorTanya)) ([#3711](https://github.com/mihonapp/mihon/pull/3711))
@@ -115,7 +115,13 @@ class UpdatesViewModel(
prefs.filterStarted, prefs.filterStarted,
prefs.filterBookmarked, prefs.filterBookmarked,
) )
.any { it != TriState.DISABLED } .any { it != TriState.DISABLED } ||
prefs.filterExcludedScanlators ||
listOf(
prefs.filterIncludedCategories,
prefs.filterExcludedCategories,
)
.any { it.isNotEmpty() }
} }
.distinctUntilChanged() .distinctUntilChanged()
@@ -53,6 +53,16 @@ class UpcomingViewModel(
private val dialog = MutableStateFlow<Dialog?>(null) 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() private val upcoming = getUpcomingItemPreferenceFlow()
.distinctUntilChanged() .distinctUntilChanged()
.flatMapLatest { .flatMapLatest {
@@ -70,12 +80,14 @@ class UpcomingViewModel(
upcoming, upcoming,
selectedYearMonth, selectedYearMonth,
dialog, dialog,
) { upcoming, selectedYearMonth, dialog -> hasActiveFilters,
) { upcoming, selectedYearMonth, dialog, hasActiveFilters ->
State( State(
selectedYearMonth = selectedYearMonth, selectedYearMonth = selectedYearMonth,
items = upcoming, items = upcoming,
events = upcoming.toEvents(), events = upcoming.toEvents(),
headerIndexes = upcoming.getHeaderIndexes(), headerIndexes = upcoming.getHeaderIndexes(),
hasActiveFilters = hasActiveFilters,
dialog = dialog, dialog = dialog,
) )
} }