Skip to content

Commit ce33dc6

Browse files
committed
remove workspace editor redirect
1 parent 8e7fbb6 commit ce33dc6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
7171
} as UmbRoute;
7272
});
7373

74-
newRoutes.push({
75-
path: '',
76-
redirectTo: newRoutes[0]?.path,
77-
});
78-
74+
// Duplicate first workspace and use it for the empty path scenario. [NL]
75+
newRoutes.push({ ...newRoutes[0], path: '' });
7976
}
8077

8178
newRoutes.push({
@@ -116,15 +113,18 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
116113
${repeat(
117114
this._workspaceViews,
118115
(view) => view.alias,
119-
(view) => html`
120-
<uui-tab
121-
href="${this._routerPath}/view/${view.meta.pathname}"
122-
.label="${view.meta.label ? this.localize.string(view.meta.label) : view.name}"
123-
?active=${'view/' + view.meta.pathname === this._activePath}>
124-
<umb-icon slot="icon" name=${view.meta.icon}></umb-icon>
125-
${view.meta.label ? this.localize.string(view.meta.label) : view.name}
126-
</uui-tab>
127-
`,
116+
(view, index) =>
117+
// Notice how we use index 0 to determine which workspace that is active with empty path. [NL]
118+
html`
119+
<uui-tab
120+
href="${this._routerPath}/view/${view.meta.pathname}"
121+
.label="${view.meta.label ? this.localize.string(view.meta.label) : view.name}"
122+
?active=${'view/' + view.meta.pathname === this._activePath ||
123+
(index === 0 && this._activePath === '')}>
124+
<umb-icon slot="icon" name=${view.meta.icon}></umb-icon>
125+
${view.meta.label ? this.localize.string(view.meta.label) : view.name}
126+
</uui-tab>
127+
`,
128128
)}
129129
</uui-tab-group>
130130
`

0 commit comments

Comments
 (0)