yohei0125 3 лет назад
Родитель
Сommit
9278ce918f
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      packages/app/src/components/PageAlert/PageStaleAlert.tsx

+ 3 - 3
packages/app/src/components/PageAlert/PageStaleAlert.tsx

@@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next';
 export const PageStaleAlert = ():JSX.Element => {
 export const PageStaleAlert = ():JSX.Element => {
   const { t } = useTranslation()
   const { t } = useTranslation()
   const { data: isEnabledStaleNotification } = useIsEnabledStaleNotification();
   const { data: isEnabledStaleNotification } = useIsEnabledStaleNotification();
-  const { data: pageData } = useSWRxCurrentPage();
 
 
-  const shouldfetch = isEnabledStaleNotification;
-  const { data: pageInfo } = useSWRxPageInfo(shouldfetch ? pageData?._id : null);
+  // determine if it should fetch or not like useSWRxPageInfo below after https://redmine.weseek.co.jp/issues/96788
+  const { data: pageData } = useSWRxCurrentPage();
+  const { data: pageInfo } = useSWRxPageInfo(isEnabledStaleNotification ? pageData?._id : null);
 
 
   const contentAge = pageInfo?.contentAge;
   const contentAge = pageInfo?.contentAge;