Fix source filterlist crash
This commit is contained in:
parent
543d46c16c
commit
0ce63d0adc
@ -79,8 +79,6 @@ object PreferenceKeys {
|
||||
|
||||
const val enabledLanguages = "source_languages"
|
||||
|
||||
const val sourcesSort = "sources_sort"
|
||||
|
||||
const val backupDirectory = "backup_directory"
|
||||
|
||||
const val downloadsDirectory = "download_directory"
|
||||
@ -266,4 +264,6 @@ object PreferenceKeys {
|
||||
const val sources_tab_categories = "sources_tab_categories"
|
||||
|
||||
const val sources_tab_source_categories = "sources_tab_source_categories"
|
||||
|
||||
const val sourcesSort = "sources_sort"
|
||||
}
|
||||
|
@ -145,8 +145,6 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun enabledLanguages() = flowPrefs.getStringSet(Keys.enabledLanguages, setOf("all", "en", Locale.getDefault().language))
|
||||
|
||||
fun sourceSorting() = flowPrefs.getInt(Keys.sourcesSort, 0)
|
||||
|
||||
fun trackUsername(sync: TrackService) = prefs.getString(Keys.trackUsername(sync.id), "")
|
||||
|
||||
fun trackPassword(sync: TrackService) = prefs.getString(Keys.trackPassword(sync.id), "")
|
||||
@ -366,4 +364,6 @@ class PreferencesHelper(val context: Context) {
|
||||
fun sourcesTabCategories() = flowPrefs.getStringSet(Keys.sources_tab_categories, mutableSetOf())
|
||||
|
||||
fun sourcesTabSourcesInCategories() = flowPrefs.getStringSet(Keys.sources_tab_source_categories, mutableSetOf())
|
||||
|
||||
fun sourceSorting() = flowPrefs.getInt(Keys.sourcesSort, 0)
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class SourceFilterController : SettingsController() {
|
||||
|
||||
onChange { newValue ->
|
||||
val checked = newValue as Boolean
|
||||
val current = preferences.disabledSources().get() as MutableSet? ?: mutableSetOf()
|
||||
val current = preferences.disabledSources().get().toMutableSet()
|
||||
if (checked) {
|
||||
current.removeAll(sources.map { it.id.toString() })
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user