use match.route.path

This commit is contained in:
Niels Lyngsø
2024-11-07 16:50:46 +01:00
parent 090a74d9b9
commit 287e2a54cc
2 changed files with 2 additions and 2 deletions

View File

@@ -123,7 +123,7 @@ export class UmbRouteContext extends UmbContextBase<UmbRouteContext> {
if (this.#activeModalPath) {
// If if there is a modal using the old path.
const activeModal = this.#modalRegistrations.find((registration) => {
return registration.generateModalPath() === this.#activeModalPath;
return '/' + registration.generateModalPath() === this.#activeModalPath;
});
if (activeModal) {
this.#modalContext?.close(activeModal.key);

View File

@@ -122,7 +122,7 @@ export class UmbRouterSlotElement extends UmbLitElement {
this.dispatchEvent(new UmbRouterSlotChangeEvent());
}
} else if (event.detail.slot === this.#modalRouter) {
const newActiveModalLocalPath = this.#modalRouter.match?.fragments.consumed ?? '';
const newActiveModalLocalPath = this.#modalRouter.match?.route.path ?? '';
this.#routeContext._internal_modalRouterChanged(newActiveModalLocalPath);
}
};