mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #2993 from H0llyW00dzZ/masks
This commit is contained in:
		@@ -393,11 +393,13 @@ export function MaskPage() {
 | 
				
			|||||||
  const [searchText, setSearchText] = useState("");
 | 
					  const [searchText, setSearchText] = useState("");
 | 
				
			||||||
  const masks = searchText.length > 0 ? searchMasks : allMasks;
 | 
					  const masks = searchText.length > 0 ? searchMasks : allMasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // simple search, will refactor later
 | 
					  // refactored already, now it accurate
 | 
				
			||||||
  const onSearch = (text: string) => {
 | 
					  const onSearch = (text: string) => {
 | 
				
			||||||
    setSearchText(text);
 | 
					    setSearchText(text);
 | 
				
			||||||
    if (text.length > 0) {
 | 
					    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);
 | 
					      setSearchMasks(result);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      setSearchMasks(allMasks);
 | 
					      setSearchMasks(allMasks);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user