Преглед изворни кода

Merge pull request #5662 from weseek/imprv/remove-page-edited-time-in-empty-page

add condition for showing authors
Yohei Shiina пре 4 година
родитељ
комит
03fc2cd4e2
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      packages/app/src/stores/ui.tsx

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

@@ -15,7 +15,7 @@ import loggerFactory from '~/utils/logger';
 import { useStaticSWR } from './use-static-swr';
 import { useStaticSWR } from './use-static-swr';
 import {
 import {
   useCurrentPageId, useCurrentPagePath, useIsEditable, useIsTrashPage, useIsUserPage,
   useCurrentPageId, useCurrentPagePath, useIsEditable, useIsTrashPage, useIsUserPage,
-  useIsNotCreatable, useIsSharedUser, useNotFoundTargetPathOrId, useIsForbidden, useIsIdenticalPath, useIsNotFoundPermalink,
+  useIsNotCreatable, useIsSharedUser, useNotFoundTargetPathOrId, useIsForbidden, useIsIdenticalPath, useIsNotFoundPermalink, useIsEmptyPageInNotFoundContext,
 } from './context';
 } from './context';
 import { IFocusable } from '~/client/interfaces/focusable';
 import { IFocusable } from '~/client/interfaces/focusable';
 import { Nullable } from '~/interfaces/common';
 import { Nullable } from '~/interfaces/common';
@@ -340,12 +340,13 @@ export const useIsAbleToShowPageAuthors = (): SWRResponse<boolean, Error> => {
   const key = 'isAbleToShowPageAuthors';
   const key = 'isAbleToShowPageAuthors';
   const { data: currentPageId } = useCurrentPageId();
   const { data: currentPageId } = useCurrentPageId();
   const { data: isUserPage } = useIsUserPage();
   const { data: isUserPage } = useIsUserPage();
+  const { data: isEmptyPageInNotFoundContext } = useIsEmptyPageInNotFoundContext();
 
 
   const includesUndefined = [currentPageId, isUserPage].some(v => v === undefined);
   const includesUndefined = [currentPageId, isUserPage].some(v => v === undefined);
   const isPageExist = currentPageId != null;
   const isPageExist = currentPageId != null;
 
 
   return useSWRImmutable(
   return useSWRImmutable(
-    includesUndefined ? null : key,
+    includesUndefined || isEmptyPageInNotFoundContext ? null : key,
     () => isPageExist && !isUserPage,
     () => isPageExist && !isUserPage,
   );
   );
 };
 };