implement with empty path instead of redirect (#18112)

This commit is contained in:
Niels Lyngsø
2025-01-24 22:32:10 +01:00
committed by GitHub
parent c9758edfb1
commit 9c02fb419f

View File

@@ -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);
},
});
}