fix null categories in Settings/Downloads/Exclude
This commit is contained in:
parent
5cc24cca29
commit
ed2c214ef3
1 changed files with 8 additions and 0 deletions
|
|
@ -112,6 +112,14 @@ object SettingsDownloadScreen : SearchableSettings {
|
||||||
return Preference.PreferenceItem.MultiSelectListPreference(
|
return Preference.PreferenceItem.MultiSelectListPreference(
|
||||||
pref = downloadPreferences.removeExcludeCategories(),
|
pref = downloadPreferences.removeExcludeCategories(),
|
||||||
title = stringResource(MR.strings.pref_remove_exclude_categories),
|
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()
|
entries = categories()
|
||||||
.associate { it.id.toString() to it.visualName }
|
.associate { it.id.toString() to it.visualName }
|
||||||
.toImmutableMap(),
|
.toImmutableMap(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue