فهرست منبع

clear the cache for the current page

Yuki Takei 2 سال پیش
والد
کامیت
c709a4c1ca

+ 2 - 5
apps/app/src/pages/_private-legacy-pages.page.tsx

@@ -49,11 +49,8 @@ const PrivateLegacyPage: NextPage<Props> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
   useCurrentUser(props.currentUser ?? null);
 
 
   // clear the cache for the current page
   // clear the cache for the current page
-  const { mutate } = useSWRxCurrentPage();
-  useIsomorphicLayoutEffect(() => {
-    mutate(undefined, { revalidate: false });
-  }, []);
-
+  //  in order to fix https://redmine.weseek.co.jp/issues/135811
+  useSWRxCurrentPage(null);
   useCurrentPageId(null);
   useCurrentPageId(null);
   useCurrentPathname('/_private-legacy-pages');
   useCurrentPathname('/_private-legacy-pages');
 
 

+ 4 - 5
apps/app/src/pages/_search.page.tsx

@@ -55,11 +55,8 @@ const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
   useCurrentUser(props.currentUser ?? null);
 
 
   // clear the cache for the current page
   // clear the cache for the current page
-  const { mutate } = useSWRxCurrentPage();
-  useIsomorphicLayoutEffect(() => {
-    mutate(undefined, { revalidate: false });
-  }, []);
-
+  //  in order to fix https://redmine.weseek.co.jp/issues/135811
+  useSWRxCurrentPage(null);
   useCurrentPageId(null);
   useCurrentPageId(null);
   useCurrentPathname('/_search');
   useCurrentPathname('/_search');
 
 
@@ -80,6 +77,8 @@ const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
 
 
   const title = generateCustomTitle(props, t('search_result.title'));
   const title = generateCustomTitle(props, t('search_result.title'));
 
 
+  console.log('_search');
+
   return (
   return (
     <>
     <>
       <Head>
       <Head>

+ 2 - 5
apps/app/src/pages/me/[[...path]].page.tsx

@@ -100,11 +100,8 @@ const MePage: NextPageWithLayout<Props> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
   useCurrentUser(props.currentUser ?? null);
 
 
   // clear the cache for the current page
   // clear the cache for the current page
-  const { mutate } = useSWRxCurrentPage();
-  useIsomorphicLayoutEffect(() => {
-    mutate(undefined, { revalidate: false });
-  }, []);
-
+  //  in order to fix https://redmine.weseek.co.jp/issues/135811
+  useSWRxCurrentPage(null);
   useCurrentPageId(null);
   useCurrentPageId(null);
   useCurrentPathname('/me');
   useCurrentPathname('/me');
 
 

+ 2 - 5
apps/app/src/pages/tags.page.tsx

@@ -50,11 +50,8 @@ const TagPage: NextPageWithLayout<CommonProps> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
   useCurrentUser(props.currentUser ?? null);
 
 
   // clear the cache for the current page
   // clear the cache for the current page
-  const { mutate } = useSWRxCurrentPage();
-  useIsomorphicLayoutEffect(() => {
-    mutate(undefined, { revalidate: false });
-  }, []);
-
+  //  in order to fix https://redmine.weseek.co.jp/issues/135811
+  useSWRxCurrentPage(null);
   useCurrentPageId(null);
   useCurrentPageId(null);
   useCurrentPathname('/tags');
   useCurrentPathname('/tags');
 
 

+ 4 - 6
apps/app/src/pages/trash.page.tsx

@@ -44,10 +44,10 @@ const TrashPage: NextPageWithLayout<CommonProps> = (props: Props) => {
   useCurrentUser(props.currentUser ?? null);
   useCurrentUser(props.currentUser ?? null);
 
 
   // clear the cache for the current page
   // clear the cache for the current page
-  const { mutate } = useSWRxCurrentPage();
-  useIsomorphicLayoutEffect(() => {
-    mutate(undefined, { revalidate: false });
-  }, []);
+  //  in order to fix https://redmine.weseek.co.jp/issues/135811
+  useSWRxCurrentPage(null);
+  useCurrentPageId(null);
+  useCurrentPathname('/trash');
 
 
   useGrowiCloudUri(props.growiCloudUri);
   useGrowiCloudUri(props.growiCloudUri);
 
 
@@ -56,8 +56,6 @@ const TrashPage: NextPageWithLayout<CommonProps> = (props: Props) => {
   useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
   useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
 
 
   useIsSearchPage(false);
   useIsSearchPage(false);
-  useCurrentPageId(null);
-  useCurrentPathname('/trash');
 
 
   // init sidebar config with UserUISettings and sidebarConfig
   // init sidebar config with UserUISettings and sidebarConfig
   useInitSidebarConfig(props.sidebarConfig, props.userUISettings);
   useInitSidebarConfig(props.sidebarConfig, props.userUISettings);