Fix source filterlist crash

This commit is contained in:
Jobobby04 2020-06-20 20:52:30 -04:00
parent 543d46c16c
commit 0ce63d0adc
3 changed files with 5 additions and 5 deletions

View File

@ -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"
}

View File

@ -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)
}

View File

@ -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 {