ref: update selectedHeroSourceCount to filter by catalog keys

This commit is contained in:
tapframe 2026-04-23 17:34:42 +05:30
parent 629ec5a7f4
commit 632f5571e1
2 changed files with 6 additions and 4 deletions

View file

@ -346,10 +346,12 @@ object HomeCatalogSettingsRepository {
HomeRepository.applyCurrentSettings()
}
private fun selectedHeroSourceCount(excludingKey: String? = null): Int =
preferences.count { (itemKey, preference) ->
itemKey != excludingKey && preference.heroSourceEnabled
private fun selectedHeroSourceCount(excludingKey: String? = null): Int {
val catalogKeys = definitions.mapTo(mutableSetOf()) { it.key }
return preferences.count { (itemKey, preference) ->
itemKey != excludingKey && itemKey in catalogKeys && preference.heroSourceEnabled
}
}
private fun move(
key: String,

View file

@ -1,5 +1,5 @@
[versions]
agp = "8.11.2"
agp = "8.13.2"
android-compileSdk = "36"
android-minSdk = "24"
android-targetSdk = "36"