From 61057f9b27bc268dc19344e1f79298e84d462a64 Mon Sep 17 00:00:00 2001 From: Fabrizio Costa Medich <134924838+FabrizioCostaMedich@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:33:34 +0100 Subject: [PATCH] fix(courses): make search case-insensitive (#535) --- src/features/courses/screens/CourseDirectoryScreen.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/courses/screens/CourseDirectoryScreen.tsx b/src/features/courses/screens/CourseDirectoryScreen.tsx index 4c63f5ac..5c86cfb2 100644 --- a/src/features/courses/screens/CourseDirectoryScreen.tsx +++ b/src/features/courses/screens/CourseDirectoryScreen.tsx @@ -119,7 +119,9 @@ const CourseFileSearchFlatList = ({ courseId, searchFilter }: SearchProps) => { useEffect(() => { if (!recentFilesQuery.data) return; setSearchResults( - recentFilesQuery.data.filter(file => file.name.includes(searchFilter)), + recentFilesQuery.data.filter(file => + file.name.toLowerCase().includes(searchFilter.toLowerCase()), + ), ); }, [recentFilesQuery.data, searchFilter]);