Skip to content

Commit

Permalink
fix case search for #36
Browse files Browse the repository at this point in the history
  • Loading branch information
joshreisner committed Sep 4, 2022
1 parent 2737b2d commit f7dee10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ export const App = () => {
}, [state]);

useEffect(() => {
setSearchWords(state.search.split(' ').filter(e => e));
setSearchWords(
state.search
.toLowerCase()
.split(' ')
.filter(e => e)
);
}, [state.search]);

//set html attributes
Expand Down
5 changes: 4 additions & 1 deletion src/helpers/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export function filter(

//search?
if (search) {
const searchWords = search.split(' ').filter(e => e);
const searchWords = search
.toLowerCase()
.split(' ')
.filter(e => e);
meetings = meetings.filter(
meeting =>
searchWords.map(word => meeting.search.includes(word)).filter(e => e)
Expand Down

0 comments on commit f7dee10

Please sign in to comment.