mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
fix(editor): surface ref find element error (#9508)
This commit is contained in:
@@ -341,7 +341,7 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
|||||||
.find(
|
.find(
|
||||||
doc =>
|
doc =>
|
||||||
doc.getBlock(this.model.reference) ||
|
doc.getBlock(this.model.reference) ||
|
||||||
getSurfaceBlock(doc)!.getElementById(this.model.reference)
|
getSurfaceBlock(doc)?.getElementById(this.model.reference)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (doc) {
|
if (doc) {
|
||||||
@@ -355,11 +355,11 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc && getSurfaceBlock(doc)) {
|
if (doc) {
|
||||||
return [
|
const surfaceBlock = getSurfaceBlock(doc);
|
||||||
getSurfaceBlock(doc)!.getElementById(this.model.reference),
|
if (surfaceBlock) {
|
||||||
doc.id,
|
return [surfaceBlock.getElementById(this.model.reference), doc.id];
|
||||||
];
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [null, this.doc.id];
|
return [null, this.doc.id];
|
||||||
|
|||||||
Reference in New Issue
Block a user