From 9c02fb419ff5ddfe8ee6024a86d5a2283f3ba1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 24 Jan 2025 22:32:10 +0100 Subject: [PATCH] implement with empty path instead of redirect (#18112) --- .../packages/core/collection/collection-view.manager.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts index 98ebdd6dd6..d7fc98c2af 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts @@ -80,7 +80,7 @@ export class UmbCollectionViewManager extends UmbControllerBase { if (views && views.length > 0) { // find the default view from the config. If it doesn't exist, use the first view const defaultView = views.find((view) => view.alias === this.#defaultViewAlias); - const fallbackView = defaultView?.meta.pathName || views[0].meta.pathName; + const fallbackView = defaultView ?? views[0]; routes = views.map((view) => { return { @@ -95,7 +95,10 @@ export class UmbCollectionViewManager extends UmbControllerBase { if (routes.length > 0) { routes.push({ path: '', - redirectTo: fallbackView, + component: () => createExtensionElement(fallbackView), + setup: () => { + this.setCurrentView(fallbackView); + }, }); }