Skip to content

Commit

Permalink
fix null categories in Settings/Downloads/Exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
cuong-tran committed Dec 6, 2024
1 parent cc96f85 commit 109ae61
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ object SettingsDownloadScreen : SearchableSettings {
return Preference.PreferenceItem.MultiSelectListPreference(
pref = downloadPreferences.removeExcludeCategories(),
title = stringResource(MR.strings.pref_remove_exclude_categories),
subtitleProvider = { v, e ->
val combined = remember(v, e) {
v.map { e[it] }
.takeIf { it.isNotEmpty() }
?.joinToString()
} ?: stringResource(MR.strings.none)
"%s".format(combined)
},
entries = categories()
.associate { it.id.toString() to it.visualName }
.toImmutableMap(),
Expand Down

0 comments on commit 109ae61

Please sign in to comment.