Просмотр исходного кода

change isEmptyPageInNotFoundContext to isEmptyPage

yohei0125 3 лет назад
Родитель
Сommit
3cf8eeaf49
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      packages/app/src/stores/context.tsx
  2. 2 2
      packages/app/src/stores/ui.tsx

+ 1 - 1
packages/app/src/stores/context.tsx

@@ -157,7 +157,7 @@ export const useIsEnabledAttachTitleHeader = (initialData?: boolean) : SWRRespon
 };
 
 export const useIsEmptyPage = (initialData?: boolean) : SWRResponse<boolean, Error> => {
-  return useStaticSWR<boolean, Error>('isEmptyPageInNotFoundContext', initialData);
+  return useStaticSWR<boolean, Error>('isEmptyPage', initialData);
 };
 export const useHasParent = (initialData?: boolean) : SWRResponse<boolean, Error> => {
   return useStaticSWR<boolean, Error>('hasParent', initialData);

+ 2 - 2
packages/app/src/stores/ui.tsx

@@ -388,13 +388,13 @@ export const useIsAbleToShowPageAuthors = (): SWRResponse<boolean, Error> => {
   const key = 'isAbleToShowPageAuthors';
   const { data: currentPageId } = useCurrentPageId();
   const { data: isUserPage } = useIsUserPage();
-  const { data: isEmptyPageInNotFoundContext } = useIsEmptyPage();
+  const { data: isEmptyPage } = useIsEmptyPage();
 
   const includesUndefined = [currentPageId, isUserPage].some(v => v === undefined);
   const isPageExist = currentPageId != null;
 
   return useSWRImmutable(
-    (includesUndefined || isEmptyPageInNotFoundContext) ? null : key,
+    (includesUndefined || isEmptyPage) ? null : key,
     () => isPageExist && !isUserPage,
   );
 };