Skip to content

Commit e4b0651

Browse files
committed
Remove shouldIncludeSection as it's always true (for now)
1 parent eb46c1d commit e4b0651

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

packages/gitbook/src/components/SiteSections/encodeClientSiteSections.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ export function encodeClientSiteSections(context: GitBookSiteContext, sections:
3030
for (const item of list) {
3131
switch (item.object) {
3232
case 'site-section-group': {
33-
const sections = item.sections
34-
.filter((section) => shouldIncludeSection(context, section))
35-
.map((section) => encodeSection(context, section));
33+
const sections = item.sections.map((section) => encodeSection(context, section));
3634

3735
// Skip empty groups
3836
if (sections.length === 0) {
@@ -74,19 +72,6 @@ function encodeSection(context: GitBookSiteContext, section: SiteSection) {
7472
};
7573
}
7674

77-
/**
78-
* Test if a section should be included in the list of sections.
79-
*/
80-
function shouldIncludeSection(context: GitBookSiteContext, section: SiteSection) {
81-
const { siteSpace: currentSiteSpace } = context;
82-
if (section.siteSpaces.length === 1) {
83-
return true;
84-
}
85-
return section.siteSpaces.some((siteSpace) =>
86-
areSiteSpacesEquivalent(siteSpace, currentSiteSpace)
87-
);
88-
}
89-
9075
/**
9176
* Find the best default site space to navigate to for a givent section:
9277
* 1. If we are on the default, continue on the default.

0 commit comments

Comments
 (0)