From ef63b28cd7f9864c439ce37394f29a4fd598c8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 19 Mar 2024 09:06:26 +0100 Subject: [PATCH] UmbRouteContext --- .../src/packages/core/router/route.context.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts index d7f41278b7..274adb3729 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/route.context.ts @@ -3,14 +3,14 @@ import { createRoutePathBuilder } from './generate-route-path-builder.function.j import type { IRoutingInfo, IRouterSlot } from '@umbraco-cms/backoffice/external/router-slot'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; -import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; +import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; import { UMB_MODAL_MANAGER_CONTEXT, type UmbModalRouteRegistration } from '@umbraco-cms/backoffice/modal'; const EmptyDiv = document.createElement('div'); type UmbRoutePlusModalKey = UmbRoute & { __modalKey: string }; -export class UmbRouteContext extends UmbControllerBase { +export class UmbRouteContext extends UmbContextBase { #mainRouter: IRouterSlot; #modalRouter: IRouterSlot; #modalRegistrations: UmbModalRouteRegistration[] = []; @@ -21,10 +21,9 @@ export class UmbRouteContext extends UmbControllerBase { #activeModalPath?: string; constructor(host: UmbControllerHost, mainRouter: IRouterSlot, modalRouter: IRouterSlot) { - super(host); + super(host, UMB_ROUTE_CONTEXT); this.#mainRouter = mainRouter; this.#modalRouter = modalRouter; - this.provideContext(UMB_ROUTE_CONTEXT, this); this.consumeContext(UMB_MODAL_MANAGER_CONTEXT, (context) => { this.#modalContext = context; this.#generateModalRoutes();