Skip to content

Commit 1f1437e

Browse files
reshma045ksen0
authored andcommitted
issue properly fixed
1 parent 649c091 commit 1f1437e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/layouts/ReferenceLayout.astro

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,11 @@ const jumpCategoryData = categoryData.length === 1
141141
: categoryData;
142142
143143
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+
}));
157149
158150
const pageJumpToState: JumpToState = {
159151
links: pageJumpToLinks,

0 commit comments

Comments
 (0)