Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#2993 from H0llyW00dzZ/masks
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa committed Oct 11, 2023
2 parents adee435 + 1604ed9 commit ba67f13
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 ba67f13

Please sign in to comment.