Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(ui): remove unused renderedTimeout and simplify lifecycle stage handling (#6463)

白熱9f8d8ee63951
diff --git a/e2e/visual-comparison/sheets/sheets-switching-render-unit.spec.ts-snapshots/switching-render-unit-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-switching-render-unit.spec.ts-snapshots/switching-render-unit-ci-chromium-linux.png
index d9600ac2bb..d246c66a7f 100644
Binary files a/e2e/visual-comparison/sheets/sheets-switching-render-unit.spec.ts-snapshots/switching-render-unit-ci-chromium-linux.png and b/e2e/visual-comparison/sheets/sheets-switching-render-unit.spec.ts-snapshots/switching-render-unit-ci-chromium-linux.png differ
diff --git a/packages/ui/src/controllers/ui/ui-shared.controller.ts b/packages/ui/src/controllers/ui/ui-shared.controller.ts
index 42521c3b3a..b6d933c09c 100644
--- a/packages/ui/src/controllers/ui/ui-shared.controller.ts
+++ b/packages/ui/src/controllers/ui/ui-shared.controller.ts
@@ -26,7 +26,6 @@ const STEADY_TIMEOUT = 3000;
*/
export abstract class SingleUnitUIController extends Disposable {
protected _steadyTimeout: number;
- protected _renderedTimeout: number;
protected _renderTimeout: number;
constructor(
@@ -43,7 +42,6 @@ export abstract class SingleUnitUIController extends Disposable {
super.dispose();
clearTimeout(this._steadyTimeout);
- clearTimeout(this._renderedTimeout);
clearTimeout(this._renderTimeout);
//@ts-ignore
delete this._instanceService;
@@ -85,16 +83,13 @@ export abstract class SingleUnitUIController extends Disposable {
if (this._currentRenderId === renderer) this._currentRenderId = null;
}));
- this._renderedTimeout = window.setTimeout(() => {
- this._lifecycleService.stage = LifecycleStages.Rendered;
- this._steadyTimeout = window.setTimeout(() => {
- this._lifecycleService.stage = LifecycleStages.Steady;
- }, STEADY_TIMEOUT);
- }, 0);
+ this._lifecycleService.stage = LifecycleStages.Rendered;
+ this._steadyTimeout = window.setTimeout(() => {
+ this._lifecycleService.stage = LifecycleStages.Steady;
+ }, STEADY_TIMEOUT);
}, 300);
} catch (error) {
clearTimeout(this._steadyTimeout);
- clearTimeout(this._renderedTimeout);
clearTimeout(this._renderTimeout);
if (error instanceof LifecycleUnreachableError) {
return;