From c6c85a1c1eabbe0e8a7d1ca388d17650bf3fe86e Mon Sep 17 00:00:00 2001 From: gggpound Date: Sat, 30 Mar 2024 14:45:20 +0800 Subject: [PATCH] fix(sheet): error while creating an empty subunit --- .../src/services/conditional-formatting.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sheets-conditional-formatting/src/services/conditional-formatting.service.ts b/packages/sheets-conditional-formatting/src/services/conditional-formatting.service.ts index 50c8c9cc82c..0bf7bbcaf29 100644 --- a/packages/sheets-conditional-formatting/src/services/conditional-formatting.service.ts +++ b/packages/sheets-conditional-formatting/src/services/conditional-formatting.service.ts @@ -40,7 +40,7 @@ type ComputeStatus = 'computing' | 'end' | 'error'; interface IComputeCache { status: ComputeStatus }; const beforeUpdateRuleResult = createInterceptorKey< { subUnitId: string; unitId: string; cfId: string }>('conditional-formatting-before-update-rule-result'); -@OnLifecycle(LifecycleStages.Starting, ConditionalFormattingService) +@OnLifecycle(LifecycleStages.Ready, ConditionalFormattingService) export class ConditionalFormattingService extends Disposable { // >> private _ruleCacheMap: Map>> = new Map(); @@ -162,8 +162,8 @@ export class ConditionalFormattingService extends Disposable { }) ) ); - const workbook = this._univerInstanceService.getCurrentUniverSheetInstance(); - handleWorkbookAdd(workbook); + const workbookList = this._univerInstanceService.getAllUniverSheetsInstance(); + workbookList.forEach((workbook) => handleWorkbookAdd(workbook)); } private _initSheetChange() {