feat: add recentlyViewed (#1357)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
JimmFly
2023-03-07 02:02:50 +08:00
committed by GitHub
parent 2a08e0b704
commit 776d30613f
5 changed files with 195 additions and 23 deletions
@@ -3,6 +3,7 @@ import React, { useEffect } from 'react';
import { Unreachable } from '../../../components/affine/affine-error-eoundary';
import { PageLoading } from '../../../components/pure/loading';
import { useSyncRecentViewsWithRouter } from '../../../hooks/affine/use-recent-views';
import { useCurrentPageId } from '../../../hooks/current/use-current-page-id';
import { useCurrentWorkspace } from '../../../hooks/current/use-current-workspace';
import { useSyncRouterWithCurrentWorkspaceAndPage } from '../../../hooks/use-sync-router-with-current-workspace-and-page';
@@ -27,6 +28,7 @@ function enableFullFlags(blockSuiteWorkspace: BlockSuiteWorkspace) {
const WorkspaceDetail: React.FC = () => {
const [pageId] = useCurrentPageId();
const [currentWorkspace] = useCurrentWorkspace();
useSyncRecentViewsWithRouter(useRouter());
useEffect(() => {
if (currentWorkspace) {
enableFullFlags(currentWorkspace.blockSuiteWorkspace);