mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +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(
|
||||
doc =>
|
||||
doc.getBlock(this.model.reference) ||
|
||||
getSurfaceBlock(doc)!.getElementById(this.model.reference)
|
||||
getSurfaceBlock(doc)?.getElementById(this.model.reference)
|
||||
);
|
||||
|
||||
if (doc) {
|
||||
@@ -355,11 +355,11 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
||||
];
|
||||
}
|
||||
|
||||
if (doc && getSurfaceBlock(doc)) {
|
||||
return [
|
||||
getSurfaceBlock(doc)!.getElementById(this.model.reference),
|
||||
doc.id,
|
||||
];
|
||||
if (doc) {
|
||||
const surfaceBlock = getSurfaceBlock(doc);
|
||||
if (surfaceBlock) {
|
||||
return [surfaceBlock.getElementById(this.model.reference), doc.id];
|
||||
}
|
||||
}
|
||||
|
||||
return [null, this.doc.id];
|
||||
|
||||
Reference in New Issue
Block a user