From aa9c8fdc6b4dc0cb875c8f947da1bd08bc70a9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 7 Nov 2023 15:50:18 +0100 Subject: [PATCH] fix section type warning --- .../backoffice/components/backoffice-main.element.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts index 8fa7c7c5f8..f944401e6d 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts @@ -75,12 +75,15 @@ export class UmbBackofficeMainElement extends UmbLitElement { this.requestUpdate('_routes', oldValue); } - private _onRouteChange = (event: UmbRouterSlotChangeEvent) => { + private _onRouteChange = async (event: UmbRouterSlotChangeEvent) => { const currentPath = event.target.localActiveViewPath || ''; const section = this._sections.find((s) => this._routePrefix + (s.manifest as any).meta.pathname === currentPath); if (!section) return; - this._backofficeContext?.setActiveSectionAlias(section.alias); - this._provideSectionContext(section.manifest as any); + await section.asPromise(); + if(section.manifest) { + this._backofficeContext?.setActiveSectionAlias(section.alias); + this._provideSectionContext(section.manifest); + } }; private _provideSectionContext(sectionManifest: ManifestSection) {