File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
src/packages/core/workspace/components/workspace-editor Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,8 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
71
71
} as UmbRoute ;
72
72
} ) ;
73
73
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 : '' } ) ;
79
76
}
80
77
81
78
newRoutes . push ( {
@@ -116,15 +113,18 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
116
113
${ repeat (
117
114
this . _workspaceViews ,
118
115
( 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
+ ` ,
128
128
) }
129
129
</ uui- tab- group>
130
130
`
You can’t perform that action at this time.
0 commit comments