Переглянути джерело

Clear page state on search page to fix navigation from search results

Uncommented useHydratePageAtoms(undefined, undefined) to clear page cache when loading search page. This prevents stale page state from interfering with navigation when clicking links in search results.

Co-authored-by: kouki-o <13145344+kouki-o@users.noreply.github.com>
copilot-swe-agent[bot] 2 місяців тому
батько
коміт
478e51b37c
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      apps/app/src/pages/_search/index.page.tsx

+ 2 - 1
apps/app/src/pages/_search/index.page.tsx

@@ -5,6 +5,7 @@ import { useTranslation } from 'next-i18next';
 
 
 import { DrawioViewerScript } from '~/components/Script/DrawioViewerScript';
 import { DrawioViewerScript } from '~/components/Script/DrawioViewerScript';
 import { useSetSearchPage } from '~/states/context';
 import { useSetSearchPage } from '~/states/context';
+import { useHydratePageAtoms } from '~/states/page/hydrate';
 
 
 import type { NextPageWithLayout } from '../_app.page';
 import type { NextPageWithLayout } from '../_app.page';
 import type { BasicLayoutConfigurationProps } from '../basic-layout-page';
 import type { BasicLayoutConfigurationProps } from '../basic-layout-page';
@@ -40,7 +41,7 @@ const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
 
 
   // clear the cache for the current page
   // clear the cache for the current page
   //  in order to fix https://redmine.weseek.co.jp/issues/135811
   //  in order to fix https://redmine.weseek.co.jp/issues/135811
-  // useHydratePageAtoms(undefined);
+  useHydratePageAtoms(undefined, undefined);
   // useCurrentPathname('/_search');
   // useCurrentPathname('/_search');
 
 
   // Hydrate server-side data
   // Hydrate server-side data