فهرست منبع

fix: initialize search keyword on mount in PrivateLegacyPages component

Shun Miyazawa 4 ماه پیش
والد
کامیت
80d617c428
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      apps/app/src/features/search/client/components/PrivateLegacyPages.tsx

+ 5 - 0
apps/app/src/features/search/client/components/PrivateLegacyPages.tsx

@@ -281,6 +281,11 @@ const PrivateLegacyPages = (): JSX.Element => {
     (ISelectableAll & IReturnSelectedPageIds) | null
     (ISelectableAll & IReturnSelectedPageIds) | null
   >(null);
   >(null);
 
 
+  // biome-ignore lint/correctness/useExhaustiveDependencies: only run on mount
+  useEffect(() => {
+    setSearchKeyword(initQ);
+  }, [])
+
   const { data, conditions, mutate } = useSWRxSearch(
   const { data, conditions, mutate } = useSWRxSearch(
     keyword,
     keyword,
     'PrivateLegacyPages',
     'PrivateLegacyPages',