Browse Source

Merge branch 'feat/gw7908-compare-all-page-versions' of https://github.com/weseek/growi into feat/gw7908-compare-all-page-versions

jam411 3 years ago
parent
commit
34e60e4210
1 changed files with 6 additions and 6 deletions
  1. 6 6
      packages/app/src/stores/page.tsx

+ 6 - 6
packages/app/src/stores/page.tsx

@@ -1,4 +1,4 @@
-import { useEffect, useMemo, useCallback } from 'react';
+import { useEffect, useMemo } from 'react';
 
 import type {
   IPageInfoForEntity, IPagePopulatedToShowRevision, IRevisionHasPageId, Nullable,
@@ -26,7 +26,7 @@ import {
 const { isPermalink: _isPermalink } = pagePathUtils;
 
 
-export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision | null): SWRResponse<IPagePopulatedToShowRevision | null> => {
+export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision|null): SWRResponse<IPagePopulatedToShowRevision|null> => {
   const key = 'currentPage';
 
   useEffect(() => {
@@ -44,14 +44,14 @@ export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision |
   });
 };
 
-export const useSWRMUTxCurrentPage = (): SWRMutationResponse<IPagePopulatedToShowRevision | null> => {
+export const useSWRMUTxCurrentPage = (): SWRMutationResponse<IPagePopulatedToShowRevision|null> => {
   const key = 'currentPage';
 
   const { data: currentPageId } = useCurrentPageId();
   const { data: shareLinkId } = useShareLinkId();
 
   // Get URL parameter for specific revisionId
-  let revisionId: string | undefined;
+  let revisionId: string|undefined;
   if (isClient()) {
     const urlParams = new URLSearchParams(window.location.search);
     const requestRevisionId = urlParams.get('revisionId');
@@ -119,7 +119,7 @@ export const useSWRxPageInfo = (
 
   const swrResult = useSWRImmutable(
     key,
-    ([endpoint, pageId, shareLinkId]: [string, string, string | null]) => apiv3Get(endpoint, { pageId, shareLinkId }).then(response => response.data),
+    ([endpoint, pageId, shareLinkId]: [string, string, string|null]) => apiv3Get(endpoint, { pageId, shareLinkId }).then(response => response.data),
     { fallbackData: initialData },
   );
 
@@ -190,7 +190,7 @@ export const useSWRxInfinitePageRevisions = (
     },
     ([endpoint, pageId, offset, limit]) => apiv3Get<SWRInfinitePageRevisionsResponse>(endpoint, { pageId, offset, limit }).then(response => response.data),
     {
-      revalidateFirstPage: false,
+      revalidateFirstPage: true,
       revalidateAll: false,
     },
   );