From 42d0d8a6da504291d44b74e40efe9d702d06ce97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Tue, 2 Jul 2024 19:37:35 +0200 Subject: [PATCH] remove workspace editor redirect --- .../workspace-editor.element.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts index ccac1676b7..cd5b245d1d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts @@ -71,11 +71,8 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { } as UmbRoute; }); - newRoutes.push({ - path: '', - redirectTo: newRoutes[0]?.path, - }); - + // Duplicate first workspace and use it for the empty path scenario. [NL] + newRoutes.push({ ...newRoutes[0], path: '' }); } newRoutes.push({ @@ -116,15 +113,18 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { ${repeat( this._workspaceViews, (view) => view.alias, - (view) => html` - - - ${view.meta.label ? this.localize.string(view.meta.label) : view.name} - - `, + (view, index) => + // Notice how we use index 0 to determine which workspace that is active with empty path. [NL] + html` + + + ${view.meta.label ? this.localize.string(view.meta.label) : view.name} + + `, )} `