refactor(editor): optimize store map (#10246)

This commit is contained in:
Saul-Mirone
2025-02-18 13:30:09 +00:00
parent 15e9acefc2
commit faf6e2c79f
7 changed files with 96 additions and 36 deletions

View File

@@ -404,7 +404,6 @@ export function createLinkedDocFromSlice(
snapshots: BlockSnapshot[],
docTitle?: string
) {
// const modelsWithChildren = (list:BlockModel[]):BlockModel[]=>list.flatMap(model=>[model,...modelsWithChildren(model.children)])
const linkedDoc = doc.workspace.createDoc({});
linkedDoc.load(() => {
const rootId = linkedDoc.addBlock('affine:page', {

View File

@@ -246,7 +246,9 @@ export class EmbedLinkedDocBlockComponent extends EmbedBlockComponent<EmbedLinke
}
get linkedDoc() {
return this.std.workspace.getDoc(this.model.pageId);
return this.std.workspace.getDoc(this.model.pageId, {
id: this.model.pageId,
});
}
private _handleDoubleClick(event: MouseEvent) {