Quellcode durchsuchen

Merge pull request #10571 from growilabs/fix/174632-pages-eligible-for-migration-are-not-displayed-when-accessing-private-legacy-pages

fix: Pages eligible for migration are not displayed when accessing private legacy pages
Yuki Takei vor 4 Monaten
Ursprung
Commit
b5f5365377

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

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

+ 6 - 6
apps/app/src/pages/_private-legacy-pages/index.page.tsx

@@ -21,6 +21,12 @@ const SearchResultLayout = dynamic(
   { ssr: false },
 );
 
+const PrivateLegacyPages = dynamic(
+  // biome-ignore lint/style/noRestrictedImports: no-problem dynamic import
+  () => import('~/features/search/client/components/PrivateLegacyPages'),
+  { ssr: false },
+);
+
 type Props = CommonInitialProps &
   CommonEachProps &
   BasicLayoutConfigurationProps &
@@ -30,12 +36,6 @@ type Props = CommonInitialProps &
 const PrivateLegacyPage: NextPage<Props> = (props: Props) => {
   const { t } = useTranslation();
 
-  const PrivateLegacyPages = dynamic(
-    // biome-ignore lint/style/noRestrictedImports: no-problem dynamic import
-    () => import('~/features/search/client/components/PrivateLegacyPages'),
-    { ssr: false },
-  );
-
   // clear the cache for the current page
   //  in order to fix https://redmine.weseek.co.jp/issues/135811
   // useHydratePageAtoms(undefined);