diff --git a/packages/sheets-hyper-link-ui/src/controllers/render-controllers/render.controller.ts b/packages/sheets-hyper-link-ui/src/controllers/render-controllers/render.controller.ts index eeedc455ee2..c36f6b830c8 100644 --- a/packages/sheets-hyper-link-ui/src/controllers/render-controllers/render.controller.ts +++ b/packages/sheets-hyper-link-ui/src/controllers/render-controllers/render.controller.ts @@ -22,6 +22,7 @@ import { SheetSkeletonManagerService } from '@univerjs/sheets-ui'; import type { IRenderContext, IRenderModule, Spreadsheet } from '@univerjs/engine-render'; import { IRenderManagerService } from '@univerjs/engine-render'; import { HyperLinkModel } from '@univerjs/sheets-hyper-link'; +import { debounceTime } from 'rxjs'; export class SheetsHyperLinkRenderController extends Disposable implements IRenderModule { constructor( @@ -55,7 +56,7 @@ export class SheetsHyperLinkRenderController extends Disposable implements IRend } }; - this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => { + this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(debounceTime(16)).subscribe(() => { markSkeletonDirty(); })); } diff --git a/packages/sheets-thread-comment/src/controllers/render-controllers/render.controller.ts b/packages/sheets-thread-comment/src/controllers/render-controllers/render.controller.ts index d1905f91257..ad4b3b3175d 100644 --- a/packages/sheets-thread-comment/src/controllers/render-controllers/render.controller.ts +++ b/packages/sheets-thread-comment/src/controllers/render-controllers/render.controller.ts @@ -22,6 +22,7 @@ import { SheetSkeletonManagerService } from '@univerjs/sheets-ui'; import type { Spreadsheet } from '@univerjs/engine-render'; import { IRenderManagerService } from '@univerjs/engine-render'; import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment-base'; +import { debounceTime } from 'rxjs'; @OnLifecycle(LifecycleStages.Ready, SheetsThreadCommentRenderController) export class SheetsThreadCommentRenderController extends Disposable { @@ -88,7 +89,7 @@ export class SheetsThreadCommentRenderController extends Disposable { } }; - this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe((update) => { + this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(debounceTime(16)).subscribe((update) => { markSkeletonDirty(); })); }