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.
|
- `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,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user