Skip to content

Commit

Permalink
Fix default category preference subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
FooIbar committed Jul 24, 2024
1 parent dd1cd68 commit e8f1a7e
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ object SettingsLibraryScreen : SearchableSettings {
val scope = rememberCoroutineScope()
val userCategoriesCount = allCategories.filterNot(Category::isSystemCategory).size

val defaultCategory by libraryPreferences.defaultCategory().collectAsState()
val selectedCategory = allCategories.find { it.id == defaultCategory.toLong() }

// For default category
val ids = listOf(libraryPreferences.defaultCategory().defaultValue()) +
allCategories.fastMap { it.id.toInt() }
Expand All @@ -95,7 +92,6 @@ object SettingsLibraryScreen : SearchableSettings {
Preference.PreferenceItem.ListPreference(
pref = libraryPreferences.defaultCategory(),
title = stringResource(MR.strings.default_category),
subtitle = selectedCategory?.visualName ?: stringResource(MR.strings.default_category_summary),
entries = ids.zip(labels).toMap().toImmutableMap(),
),
Preference.PreferenceItem.SwitchPreference(
Expand Down

0 comments on commit e8f1a7e

Please sign in to comment.