feat: add recentlyViewed (#1357)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
JimmFlyandhimself65 authored and GitHub committed 2023-03-06 18:02:50 +00:00
1 parent 2a08e0b704
commit 776d30613f
5 files changed
+195 -23

No files matched your search

@@ -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);