fix(editor): convert note to linked doc from edgeless (#11828)

Closes: BS-3244
This commit is contained in:
Saul-Mirone
2025-04-21 03:18:14 +00:00
parent e0a1d87cee
commit c74b5dc214
2 changed files with 45 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
import { isFrameBlock } from '@blocksuite/affine-block-frame';
import { getSurfaceBlock, isNoteBlock } from '@blocksuite/affine-block-surface';
import type { FrameBlockModel, NoteBlockModel } from '@blocksuite/affine-model';
import {
type FrameBlockModel,
type NoteBlockModel,
NoteDisplayMode,
} from '@blocksuite/affine-model';
import { replaceIdMiddleware } from '@blocksuite/affine-shared/adapters';
import { DocModeProvider } from '@blocksuite/affine-shared/services';
import { getBlockProps } from '@blocksuite/affine-shared/utils';
@@ -28,6 +32,7 @@ export function createLinkedDocFromNote(
console.error('Failed to create linked doc from note');
return;
}
blockSnapshot.props.displayMode = NoteDisplayMode.DocAndEdgeless;
const linkedDoc = _doc.getStore({ id: doc.id });
linkedDoc.load(() => {
const rootId = linkedDoc.addBlock('affine:page', {