Skip to content

Commit 9c02fb4

Browse files
authored
implement with empty path instead of redirect (#18112)
1 parent c9758ed commit 9c02fb4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class UmbCollectionViewManager extends UmbControllerBase {
8080
if (views && views.length > 0) {
8181
// find the default view from the config. If it doesn't exist, use the first view
8282
const defaultView = views.find((view) => view.alias === this.#defaultViewAlias);
83-
const fallbackView = defaultView?.meta.pathName || views[0].meta.pathName;
83+
const fallbackView = defaultView ?? views[0];
8484

8585
routes = views.map((view) => {
8686
return {
@@ -95,7 +95,10 @@ export class UmbCollectionViewManager extends UmbControllerBase {
9595
if (routes.length > 0) {
9696
routes.push({
9797
path: '',
98-
redirectTo: fallbackView,
98+
component: () => createExtensionElement(fallbackView),
99+
setup: () => {
100+
this.setCurrentView(fallbackView);
101+
},
99102
});
100103
}
101104

0 commit comments

Comments
 (0)