yohei0125 4 лет назад
Родитель
Сommit
d74b9e9fef

+ 3 - 3
packages/app/src/client/services/ContextExtractor.tsx

@@ -7,8 +7,8 @@ import {
   useIsDeleted, useIsNotCreatable, useIsTrashPage, useIsUserPage, useLastUpdateUsername,
   useIsDeleted, useIsNotCreatable, useIsTrashPage, useIsUserPage, useLastUpdateUsername,
   useCurrentPageId, usePageIdOnHackmd, usePageUser, useCurrentPagePath, useRevisionCreatedAt, useRevisionId, useRevisionIdHackmdSynced,
   useCurrentPageId, usePageIdOnHackmd, usePageUser, useCurrentPagePath, useRevisionCreatedAt, useRevisionId, useRevisionIdHackmdSynced,
   useShareLinkId, useShareLinksNumber, useTemplateTagData, useCurrentUpdatedAt, useCreator, useRevisionAuthor, useCurrentUser, useTargetAndAncestors,
   useShareLinkId, useShareLinksNumber, useTemplateTagData, useCurrentUpdatedAt, useCreator, useRevisionAuthor, useCurrentUser, useTargetAndAncestors,
-  useSlackChannels, useNotFoundTargetPathOrId, useIsSearchPage, useIsForbidden, useIsIdenticalPath,
-  useIsAclEnabled, useIsSearchServiceConfigured, useIsSearchServiceReachable, useIsEnabledAttachTitleHeader, useIsNotFoundPermalink, useIsEmptyPageContext,
+  useSlackChannels, useNotFoundTargetPathOrId, useIsSearchPage, useIsForbidden, useIsIdenticalPath, useIsAclEnabled, useIsSearchServiceConfigured,
+  useIsSearchServiceReachable, useIsEnabledAttachTitleHeader, useIsNotFoundPermalink, useIsEmptyPageInNotFoundContext,
 } from '../../stores/context';
 } from '../../stores/context';
 import {
 import {
   useIsDeviceSmallerThanMd, useIsDeviceSmallerThanLg,
   useIsDeviceSmallerThanMd, useIsDeviceSmallerThanLg,
@@ -140,7 +140,7 @@ const ContextExtractorOnce: FC = () => {
   useNotFoundTargetPathOrId(notFoundTargetPathOrId);
   useNotFoundTargetPathOrId(notFoundTargetPathOrId);
   useIsNotFoundPermalink(isNotFoundPermalink);
   useIsNotFoundPermalink(isNotFoundPermalink);
   useIsSearchPage(isSearchPage);
   useIsSearchPage(isSearchPage);
-  useIsEmptyPageContext(notFoundContent != null && pageId != null);
+  useIsEmptyPageInNotFoundContext(notFoundContent != null && pageId != null);
 
 
   // Navigation
   // Navigation
   usePreferDrawerModeByUser();
   usePreferDrawerModeByUser();

+ 3 - 3
packages/app/src/components/Page/DisplaySwitcher.tsx

@@ -7,7 +7,7 @@ import { pagePathUtils } from '@growi/core';
 import { EditorMode, useEditorMode } from '~/stores/ui';
 import { EditorMode, useEditorMode } from '~/stores/ui';
 import { useDescendantsPageListModal } from '~/stores/modal';
 import { useDescendantsPageListModal } from '~/stores/modal';
 import {
 import {
-  useCurrentPagePath, useIsSharedUser, useIsEditable, useCurrentPageId, useIsUserPage, usePageUser, useIsEmptyPageContext,
+  useCurrentPagePath, useIsSharedUser, useIsEditable, useCurrentPageId, useIsUserPage, usePageUser, useIsEmptyPageInNotFoundContext,
 } from '~/stores/context';
 } from '~/stores/context';
 
 
 
 
@@ -36,7 +36,7 @@ const DisplaySwitcher = (): JSX.Element => {
   // get element for smoothScroll
   // get element for smoothScroll
   const getCommentListDom = useMemo(() => { return document.getElementById('page-comments-list') }, []);
   const getCommentListDom = useMemo(() => { return document.getElementById('page-comments-list') }, []);
 
 
-  const { data: isEmptyPageContext } = useIsEmptyPageContext();
+  const { data: isEmptyPageInNotFoundContext } = useIsEmptyPageInNotFoundContext();
   const { data: currentPageId } = useCurrentPageId();
   const { data: currentPageId } = useCurrentPageId();
   const { data: currentPath } = useCurrentPagePath();
   const { data: currentPath } = useCurrentPagePath();
   const { data: isSharedUser } = useIsSharedUser();
   const { data: isSharedUser } = useIsSharedUser();
@@ -93,7 +93,7 @@ const DisplaySwitcher = (): JSX.Element => {
                   ) }
                   ) }
 
 
                   <div className="d-none d-lg-block">
                   <div className="d-none d-lg-block">
-                    {!isEmptyPageContext && (
+                    {!isEmptyPageInNotFoundContext && (
                       <div id="revision-toc" className="revision-toc">
                       <div id="revision-toc" className="revision-toc">
                         <TableOfContents />
                         <TableOfContents />
                       </div>
                       </div>

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

@@ -156,8 +156,8 @@ export const useIsEnabledAttachTitleHeader = (initialData?: boolean) : SWRRespon
   return useStaticSWR<boolean, Error>('isEnabledAttachTitleHeader', initialData);
   return useStaticSWR<boolean, Error>('isEnabledAttachTitleHeader', initialData);
 };
 };
 
 
-export const useIsEmptyPageContext = (initialData?: boolean) : SWRResponse<boolean, Error> => {
-  return useStaticSWR<boolean, Error>('isEmptyPageContext', initialData);
+export const useIsEmptyPageInNotFoundContext = (initialData?: boolean) : SWRResponse<boolean, Error> => {
+  return useStaticSWR<boolean, Error>('isEmptyPageInNotFoundContext', initialData);
 };
 };
 
 
 /** **********************************************************
 /** **********************************************************