Fixed All Sources in Filter list

This commit is contained in:
Jobobby04 2020-05-04 13:58:08 -04:00
parent 0300c1057b
commit 49580a7630

View File

@ -50,6 +50,7 @@ class SettingsSourcesController : SettingsController() {
sorting = SourcesSort.from(preferences.sourceSorting().get()) ?: SourcesSort.Alpha
activity?.invalidateOptionsMenu()
// Get the list of active language codes.
val activeLangsCodes = preferences.enabledLanguages().get()
@ -115,11 +116,11 @@ class SettingsSourcesController : SettingsController() {
onChange { newValue ->
val checked = newValue as Boolean
val current = preferences.hiddenCatalogues().get() ?: mutableSetOf()
val current = preferences.hiddenCatalogues().get() as MutableSet? ?: mutableSetOf()
if (checked) {
current.minus(sources.map { it.id.toString() })
current.removeAll(sources.map { it.id.toString() })
} else {
current.plus(sources.map { it.id.toString() })
current.addAll(sources.map { it.id.toString() })
}
preferences.hiddenCatalogues().set(current)
group.removeAll()