fix(editor): improve performence of link card render (#12937)
Close [BS-3097](https://linear.app/affine-design/issue/BS-3607/linkdoccard-重复渲染导致卡顿)  #### PR Dependency Tree * **PR #12937** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Improved the handling of updates for embedded linked documents, reducing unnecessary reloads when the document list changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
320d2f5bdf
commit
a6edb6192f
@ -495,14 +495,6 @@ export class EmbedLinkedDocBlockComponent extends EmbedBlockComponent<EmbedLinke
|
|||||||
|
|
||||||
const linkedDoc = this.linkedDoc;
|
const linkedDoc = this.linkedDoc;
|
||||||
if (linkedDoc) {
|
if (linkedDoc) {
|
||||||
this.disposables.add(
|
|
||||||
linkedDoc.workspace.slots.docListUpdated.subscribe(() => {
|
|
||||||
this._load().catch(e => {
|
|
||||||
console.error(e);
|
|
||||||
this.isError = true;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
// Should throttle the blockUpdated event to avoid too many re-renders
|
// Should throttle the blockUpdated event to avoid too many re-renders
|
||||||
// Because the blockUpdated event is triggered too frequently at some cases
|
// Because the blockUpdated event is triggered too frequently at some cases
|
||||||
this.disposables.add(
|
this.disposables.add(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user