|
|
@@ -4,7 +4,9 @@ import type { IUser } from '@growi/core';
|
|
|
import type { GetServerSideProps, GetServerSidePropsContext } from 'next';
|
|
|
import { useTranslation } from 'next-i18next';
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
|
|
+import dynamic from 'next/dynamic';
|
|
|
import Head from 'next/head';
|
|
|
+import { useIsomorphicLayoutEffect } from 'usehooks-ts';
|
|
|
|
|
|
import SearchResultLayout from '~/components/Layout/SearchResultLayout';
|
|
|
import { DrawioViewerScript } from '~/components/Script/DrawioViewerScript';
|
|
|
@@ -16,8 +18,6 @@ import {
|
|
|
} from '~/stores/context';
|
|
|
import { useCurrentPageId, useSWRxCurrentPage } from '~/stores/page';
|
|
|
|
|
|
-import { SearchPage } from '../components/SearchPage';
|
|
|
-
|
|
|
import type { NextPageWithLayout } from './_app.page';
|
|
|
import type { CommonProps } from './utils/commons';
|
|
|
import {
|
|
|
@@ -25,6 +25,9 @@ import {
|
|
|
} from './utils/commons';
|
|
|
|
|
|
|
|
|
+const SearchPage = dynamic(() => import('../components/SearchPage').then(mod => mod.SearchPage), { ssr: false });
|
|
|
+
|
|
|
+
|
|
|
type Props = CommonProps & {
|
|
|
currentUser: IUser,
|
|
|
|
|
|
@@ -52,8 +55,8 @@ const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
|
|
|
useCurrentUser(props.currentUser ?? null);
|
|
|
|
|
|
// clear the cache for the current page
|
|
|
- const { mutate } = useSWRxCurrentPage();
|
|
|
- mutate(undefined, { revalidate: false });
|
|
|
+ // in order to fix https://redmine.weseek.co.jp/issues/135811
|
|
|
+ useSWRxCurrentPage(null);
|
|
|
useCurrentPageId(null);
|
|
|
useCurrentPathname('/_search');
|
|
|
|