From d1457ba5a4afccea829882634f182a2bf46dfba6 Mon Sep 17 00:00:00 2001 From: Cael Date: Sat, 26 Oct 2024 16:56:34 +0800 Subject: [PATCH] fix: fix serach bar and refresh router when first loaded --- .../view/components/Searchbar/Searchbar.tsx | 6 +-- src/contexts/App/AppProvider.tsx | 3 ++ src/contexts/Popup/Popup.module.css | 18 --------- src/contexts/Popup/Popup.tsx | 22 ----------- src/contexts/Popup/PopupProvider.tsx | 38 ------------------- 5 files changed, 6 insertions(+), 81 deletions(-) delete mode 100644 src/contexts/Popup/Popup.module.css delete mode 100644 src/contexts/Popup/Popup.tsx delete mode 100644 src/contexts/Popup/PopupProvider.tsx diff --git a/src/app/view/components/Searchbar/Searchbar.tsx b/src/app/view/components/Searchbar/Searchbar.tsx index 4229808..16e2dc2 100644 --- a/src/app/view/components/Searchbar/Searchbar.tsx +++ b/src/app/view/components/Searchbar/Searchbar.tsx @@ -12,7 +12,7 @@ export default function Searchbar() { const [localSearchKeywords, setLocalSearchKeywords] = useState(""); useEffect(() => { - const timer = setTimeout(() => setSearchKeywords(localSearchKeywords), 500); + const timer = setTimeout(() => setSearchKeywords(localSearchKeywords.toLocaleLowerCase()), 500); return () => clearTimeout(timer); }, [localSearchKeywords]); @@ -32,8 +32,8 @@ export default function Searchbar() { {localSearchKeywords.length !== 0 && (