We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77747b8 commit cd345dbCopy full SHA for cd345db
packages/compass-components/src/components/context-menu.tsx
@@ -142,12 +142,10 @@ export function useContextMenuGroups(
142
// Cleanup all undefined fields across items and groups which is used
143
// for conditional displaying of groups and items.
144
return groups
145
- .filter((groupItems) => groupItems !== undefined)
146
- .map((groupItems) =>
147
- groupItems.filter(
148
- (item): item is ContextMenuItem => item !== undefined
149
- )
150
- );
+ .filter(
+ (groupItems) => groupItems !== undefined && groupItems.length > 0
+ )
+ .map((groupItems) => groupItems!.filter((item) => item !== undefined));
151
},
152
// eslint-disable-next-line react-hooks/exhaustive-deps
153
dependencies
0 commit comments