diff --git a/TODO.md b/TODO.md index 3cbea451..98ed6cd7 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,5 @@ - Refactoring - Don't show the highlight rectangle sliding when clicking room - - Make room loading faster - - Filter smart case - Make all icon SVG files white/black, since we can now use ColorOverlay - Make the icon blue in EditAccount when hovering and no avatar set diff --git a/src/qml/utils.js b/src/qml/utils.js index 35a2a7a4..385a240b 100644 --- a/src/qml/utils.js +++ b/src/qml/utils.js @@ -74,12 +74,15 @@ function processedEventText(ev) { function filterMatches(filter, text) { - filter = filter.toLowerCase() - text = text.toLowerCase() + let filter_lower = filter.toLowerCase() - let words = filter.split(" ") + if (filter_lower == filter) { + // Consider case only if filter isn't all lowercase (smart case) + filter = filter_lower + text = text.toLowerCase() + } - for (let word of words) { + for (let word of filter.split(" ")) { if (word && ! text.includes(word)) { return false }