mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 13:15:51 +08:00
fix: hook useRecentlyViewed (#1430)
Co-authored-by: JimmFly <yangjinfei001@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ export function useSyncRecentViewsWithRouter(router: NextRouter) {
|
||||
const [workspace] = useCurrentWorkspace();
|
||||
const workspaceId = workspace?.id || null;
|
||||
const blockSuiteWorkspace = workspace?.blockSuiteWorkspace || null;
|
||||
const pageId = router.query.pageId as string;
|
||||
const pageId = router.query.pageId;
|
||||
const set = useSetAtom(workspaceRecentViresWriteAtom);
|
||||
const meta = usePageMeta(blockSuiteWorkspace).find(
|
||||
meta => meta.id === pageId
|
||||
@@ -31,7 +31,6 @@ export function useSyncRecentViewsWithRouter(router: NextRouter) {
|
||||
if (!workspaceId) return;
|
||||
if (pageId && meta) {
|
||||
set(workspaceId, {
|
||||
title: meta.title || 'Untitled',
|
||||
id: pageId as string,
|
||||
mode: meta.mode || 'page',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user