change route setup

This commit is contained in:
Niels Lyngsø
2024-12-03 20:51:53 +01:00
committed by Jacob Overgaard
parent a4017e6dce
commit a582732429

View File

@@ -187,21 +187,20 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
});
}
routes.push({
path: 'root',
component: () => import('./content-type-design-editor-tab.element.js'),
setup: (component) => {
(component as UmbContentTypeDesignEditorTabElement).containerId = null;
},
});
if (this._hasRootGroups) {
if (this._hasRootGroups || this._tabs.length === 0) {
routes.push({
path: 'root',
component: () => import('./content-type-design-editor-tab.element.js'),
setup: (component) => {
(component as UmbContentTypeDesignEditorTabElement).containerId = null;
},
});
routes.push({
path: '',
redirectTo: 'root',
guards: [() => this._activeTabId === undefined],
});
} else if (routes.length !== 0) {
} else {
routes.push({
path: '',
redirectTo: routes[0]?.path,