2
0
jam411 3 жил өмнө
parent
commit
a6ad5eae27

+ 2 - 2
packages/app/src/components/Page.tsx

@@ -18,11 +18,11 @@ import {
 import {
   useSWRxSlackChannels, useIsSlackEnabled, usePageTagsForEditors, useIsEnabledUnsavedWarning,
 } from '~/stores/editor';
-import { useSWRxCurrentPage } from '~/stores/page';
+import { useSWRxCurrentPage, useRequestRevisionPage } from '~/stores/page';
 import { useViewOptions } from '~/stores/renderer';
 import {
   useCurrentPageTocNode,
-  useEditorMode, useIsMobile, useRequestRevisionPage,
+  useEditorMode, useIsMobile,
 } from '~/stores/ui';
 import loggerFactory from '~/utils/logger';
 

+ 3 - 2
packages/app/src/pages/[[...path]].page.tsx

@@ -36,13 +36,14 @@ import type { IUserUISettings } from '~/interfaces/user-ui-settings';
 import type { PageModel, PageDocument } from '~/server/models/page';
 import type { PageRedirectModel } from '~/server/models/page-redirect';
 import type { UserUISettingsModel } from '~/server/models/user-ui-settings';
-import { useSWRxCurrentPage, useSWRxIsGrantNormalized, useSWRxPageInfo } from '~/stores/page';
+import {
+  useSWRxCurrentPage, useSWRxIsGrantNormalized, useSWRxPageInfo, useRequestRevisionPage,
+} from '~/stores/page';
 import { useRedirectFrom } from '~/stores/page-redirect';
 import {
   EditorMode,
   useEditorMode, useSelectedGrant,
   usePreferDrawerModeByUser, usePreferDrawerModeOnEditByUser, useSidebarCollapsed, useCurrentSidebarContents, useCurrentProductNavWidth,
-  useRequestRevisionPage,
 } from '~/stores/ui';
 import loggerFactory from '~/utils/logger';
 

+ 5 - 1
packages/app/src/stores/page.tsx

@@ -16,7 +16,7 @@ import { IRevisionsForPagination } from '~/interfaces/revision';
 import { IPageTagsInfo } from '../interfaces/tag';
 
 import { useCurrentPageId, useCurrentPathname } from './context';
-
+import { useStaticSWR } from './use-static-swr';
 
 const { isPermalink: _isPermalink } = pagePathUtils;
 
@@ -141,6 +141,10 @@ export const useSWRxApplicableGrant = (
   );
 };
 
+export const useRequestRevisionPage = (initialData?: IPagePopulatedToShowRevision): SWRResponse<IPagePopulatedToShowRevision, Error> => {
+  return useStaticSWR('requestRevisionPage', initialData);
+};
+
 
 /** **********************************************************
  *                     Computed states

+ 0 - 4
packages/app/src/stores/ui.tsx

@@ -397,10 +397,6 @@ export const usePageTreeDescCountMap = (initialData?: UpdateDescCountData): SWRR
   };
 };
 
-export const useRequestRevisionPage = (initialData?: IPagePopulatedToShowRevision): SWRResponse<IPagePopulatedToShowRevision, Error> => {
-  return useStaticSWR('requestRevisionPage', initialData);
-};
-
 
 /** **********************************************************
  *                          SWR Hooks