Ignore extraneous spaces when filtering the folder list
Filter strings with e.g. a trailing space were split into the search term and the empty string. But the empty string can be found in every folder name, so all folders were displayed. This change drops all search terms that are the empty string.
@@ -146,6 +146,7 @@ class ManageFoldersFragment : Fragment() {
val locale = Locale.getDefault()
val displayName = item.displayName.toLowerCase(locale)
return constraint.splitToSequence(" ")
+ .filter { it.isNotEmpty() }
.map { it.toLowerCase(locale) }
.any { it in displayName }
}
