mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
refactor(page): rename pageId
This commit is contained in:
@@ -6,16 +6,16 @@ import { CreateView } from '@toeverything/framework/virgo';
|
||||
type RefLinkView = CreateView;
|
||||
|
||||
export const RefLinkView = ({ block, editor }: RefLinkView) => {
|
||||
const page_id = useMemo(() => block.getProperty('reference'), [block]);
|
||||
const pageId = useMemo(() => block.getProperty('reference'), [block]);
|
||||
|
||||
const [block_content, set_block] =
|
||||
useState<Awaited<ReturnType<typeof editor.search>>[number]>();
|
||||
|
||||
useEffect(() => {
|
||||
editor
|
||||
.search({ tag: `id:${page_id}` })
|
||||
.search({ tag: `id:${pageId}` })
|
||||
.then(block => set_block(block[0]));
|
||||
}, [editor, page_id]);
|
||||
}, [editor, pageId]);
|
||||
|
||||
return <InlineRefLink block={block_content} pageId={page_id} />;
|
||||
return <InlineRefLink block={block_content} pageId={pageId} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user