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

View file

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