mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: page references in list/database (#3702)
This commit is contained in:
@@ -7,8 +7,8 @@ import { useBlockSuiteWorkspacePage } from './use-block-suite-workspace-page';
|
||||
const weakMap = new WeakMap<Page, Atom<string[]>>();
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user