From 1eaf228a30971332229303d1ae35d99e075a70ac Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Sat, 12 Aug 2023 00:20:33 +0800 Subject: [PATCH] fix: page references in list/database (#3702) --- packages/hooks/src/use-block-suite-page-references.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hooks/src/use-block-suite-page-references.ts b/packages/hooks/src/use-block-suite-page-references.ts index 8a46cde154..60c7d84028 100644 --- a/packages/hooks/src/use-block-suite-page-references.ts +++ b/packages/hooks/src/use-block-suite-page-references.ts @@ -7,8 +7,8 @@ import { useBlockSuiteWorkspacePage } from './use-block-suite-workspace-page'; const weakMap = new WeakMap>(); function getPageReferences(page: Page): string[] { // todo: is there a way to use page indexer to get all references? - return page - .getBlockByFlavour('affine:paragraph') + return ['affine:paragraph', 'affine:list', 'affine:database'] + .flatMap(f => page.getBlockByFlavour(f)) .flatMap(b => b.text?.toDelta()) .map(v => v?.attributes?.reference?.pageId) .filter(Boolean);