fix section type warning

This commit is contained in:
Niels Lyngsø
2023-11-07 15:50:18 +01:00
parent 7aaad3b0be
commit aa9c8fdc6b

View File

@@ -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) {