@ -77,7 +77,10 @@ suspend fun BookSource.clearExploreKindsCache() {
}
fun BookSource.contains(word: String): Boolean {
fun BookSource.contains(word: String?): Boolean {
if (word.isNullOrEmpty()) {
return true
return bookSourceName.contains(word)
|| bookSourceUrl.contains(word)
|| bookSourceGroup?.contains(word) == true
@ -117,9 +117,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
withContext(IO) {
if (binding.rbSource.isChecked) {
sources.filter { source ->
screenText?.let { screenText ->
source.contains(screenText)
} ?: true
}.let {
screenSources.clear()
screenSources.addAll(it)