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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(ui): fix layout service throwing error (#1490)
Wenzhao Huc2ee6d2c621c
diff --git a/packages/docs-ui/src/controllers/doc-ui.controller.ts b/packages/docs-ui/src/controllers/doc-ui.controller.tsindex 28b7fe3951..f5edcc2f10 100644--- a/packages/docs-ui/src/controllers/doc-ui.controller.ts+++ b/packages/docs-ui/src/controllers/doc-ui.controller.ts@@ -94,6 +94,7 @@ export class DocUIController extends Disposable {this._initCustomComponents();this._initMenus();this._initDocBackground();+ this._initFocusHandler();}private _initDocBackground() {diff --git a/packages/ui/src/services/layout/layout.service.ts b/packages/ui/src/services/layout/layout.service.tsindex f62dc805d2..eaa9cadb60 100644--- a/packages/ui/src/services/layout/layout.service.ts+++ b/packages/ui/src/services/layout/layout.service.ts@@ -87,11 +87,9 @@ export class DesktopLayoutService extends Disposable implements ILayoutService {handler = this._focusHandlers.get(UniverInstanceType.SLIDE);}- if (!handler) {- throw new Error('[DesktopLayoutService]: handler is not registered!');+ if (handler) {+ handler(currentFocused.getUnitId());}-- handler(currentFocused.getUnitId());}registerFocusHandler(type: UniverInstanceType, handler: FocusHandlerFn): IDisposable {