Show updates and upcoming filter icon as active for categories (#3772)
This commit is contained in:
@@ -11,6 +11,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
|
||||
- `Other` - for technical stuff.
|
||||
|
||||
## [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 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))
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user