Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 12, 2023
2 parents df3a6a1 + ba67f13 commit 6671670
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/mask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,13 @@ export function MaskPage() {
const [searchText, setSearchText] = useState("");
const masks = searchText.length > 0 ? searchMasks : allMasks;

// simple search, will refactor later
// refactored already, now it accurate
const onSearch = (text: string) => {
setSearchText(text);
if (text.length > 0) {
const result = allMasks.filter((m) => m.name.includes(text));
const result = allMasks.filter((m) =>
m.name.toLowerCase().includes(text.toLowerCase())
);
setSearchMasks(result);
} else {
setSearchMasks(allMasks);
Expand Down

0 comments on commit 6671670

Please sign in to comment.