File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -141,19 +141,11 @@ const jumpCategoryData = categoryData.length === 1
141
141
: categoryData ;
142
142
143
143
const pageJumpToLinks: JumpToLink [] = jumpCategoryData
144
- .map ((categoryItem ) => ({
145
- label: categoryItem .name as string ,
146
- url: ` #${categoryItem .name } ` ,
147
- }))
148
- .filter ((link , index ) => {
149
- if (link .label === undefined ) {
150
- return false ; // Completely remove all undefined labels
151
- }
152
- if (categoryData .length === 1 && index === 1 ) {
153
- return false ; // Specifically remove the redundant subcat under main cat
154
- }
155
- return true ;
156
- });
144
+ .filter ((category ) => !! category .name ) // REMOVE undefined ones
145
+ .map ((category ) => ({
146
+ label: category .name as string ,
147
+ url: ` #${category .name } ` ,
148
+ }));
157
149
158
150
const pageJumpToState: JumpToState = {
159
151
links: pageJumpToLinks ,
You can’t perform that action at this time.
0 commit comments