Skip to content

Commit

Permalink
fix: navigator sections isVisible handling
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Nov 2, 2021
1 parent c26eb75 commit 1f4ad43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ export function makeResourceKindNavSection(
isInitialized: scope => {
return scope.activeResources.length > 0;
},
isVisible: scope => {
return scope.activeResources.length === 0;
},
shouldBeVisibleBeforeInitialized: true,
},
itemBlueprint: {
Expand Down
5 changes: 2 additions & 3 deletions src/navsections/sectionBlueprintMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ const processSectionBlueprints = (state: RootState, dispatch: AppDispatch) => {
isVisible:
Boolean(sectionBuilder?.shouldBeVisibleBeforeInitialized === true && !isSectionInitialized) ||
(isSectionInitialized &&
(Boolean(sectionBuilder?.isVisible && sectionBuilder.isVisible(sectionScope, rawItems)) ||
visibleItemIds.length > 0 ||
visibleGroupIds.length > 0)),
Boolean(sectionBuilder?.isVisible ? sectionBuilder.isVisible(sectionScope, rawItems) : true) &&
(visibleItemIds.length > 0 || visibleGroupIds.length > 0)),
isInitialized: isSectionInitialized,
isSelected: isSectionSelected,
isHighlighted: isSectionHighlighted,
Expand Down

0 comments on commit 1f4ad43

Please sign in to comment.