diff --git a/packages/frontend/core/src/components/affine/page-history-modal/data.ts b/packages/frontend/core/src/components/affine/page-history-modal/data.ts index 6eb0f5f9a0..3debe46c18 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/data.ts +++ b/packages/frontend/core/src/components/affine/page-history-modal/data.ts @@ -63,11 +63,7 @@ export const useDocSnapshotList = (workspaceId: string, pageDocId: string) => { return data.flatMap(page => page.workspace.histories); }, [data]); - return [ - histories, - shouldLoadMore ? loadMore : undefined, - loadingMore, - ] as const; + return [histories, shouldLoadMore ? loadMore : false, !!loadingMore] as const; }; const snapshotFetcher = async ( diff --git a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx index 9efed36753..7210c21258 100644 --- a/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx +++ b/packages/frontend/core/src/components/affine/page-history-modal/history-modal.tsx @@ -17,6 +17,7 @@ import type { DialogContentProps } from '@radix-ui/react-dialog'; import { Doc, type PageMode, Workspace } from '@toeverything/infra'; import { useService } from '@toeverything/infra/di'; import { atom, useAtom, useSetAtom } from 'jotai'; +import { range } from 'lodash-es'; import { Fragment, type PropsWithChildren, @@ -24,6 +25,7 @@ import { useCallback, useLayoutEffect, useMemo, + useRef, useState, } from 'react'; import { encodeStateAsUpdate } from 'yjs'; @@ -90,6 +92,7 @@ const ModalContainer = ({ interface HistoryEditorPreviewProps { ts?: string; + historyList: HistoryList; snapshotPage?: BlockSuiteDoc; mode: PageMode; onModeChange: (mode: PageMode) => void; @@ -98,6 +101,7 @@ interface HistoryEditorPreviewProps { const HistoryEditorPreview = ({ ts, + historyList, snapshotPage, onModeChange, mode, @@ -110,11 +114,9 @@ const HistoryEditorPreview = ({ onModeChange('edgeless'); }, [onModeChange]); - return ( -