Revert "fix: api compatibility with blocksuite"

This reverts commit 00f44c72ce.
This commit is contained in:
himself65
2023-04-20 22:53:32 -05:00
parent 00f44c72ce
commit 6cddacb953
2 changed files with 3 additions and 13 deletions

View File

@@ -1,6 +1,5 @@
import type { TreeViewProps } from '@affine/component';
import { DebugLogger } from '@affine/debug';
import { initPage } from '@affine/env/blocksuite';
import type { PageMeta } from '@blocksuite/store';
import { nanoid } from '@blocksuite/store';
import { usePageMetaHelper } from '@toeverything/hooks/use-block-suite-page-meta';
@@ -65,16 +64,7 @@ export function usePinboardHandler({
const addPin = useCallback(
(parentId: string) => {
const id = nanoid();
const page = createPage(id);
initPage(page);
page.addBlock('affine:paragraph', {
text: page.Text.fromDelta([
{
insert: ' ',
attributes: { reference: { type: 'LinkedPage', pageId: page.id } },
},
]),
});
createPage(id, parentId);
onAdd?.(id, parentId);
addReferenceLink(parentId, id);
},