diff --git a/src/renderer/components/item-object-list/content.tsx b/src/renderer/components/item-object-list/content.tsx
index 07756760a9..f10910e8f0 100644
--- a/src/renderer/components/item-object-list/content.tsx
+++ b/src/renderer/components/item-object-list/content.tsx
@@ -252,7 +252,7 @@ class NonInjectedItemListLayoutContent<
}
renderTableHeader() {
- const { customizeTableRowProps, renderTableHeader, isSelectable, isConfigurable, store } = this.props;
+ const { customizeTableRowProps, renderTableHeader, isSelectable, isConfigurable, store, tableId } = this.props;
if (!renderTableHeader) {
return null;
@@ -283,7 +283,10 @@ class NonInjectedItemListLayoutContent<
))
}
- {isConfigurable && this.renderColumnVisibilityMenu()}
+ {(isConfigurable && tableId)
+ ? this.renderColumnVisibilityMenu(tableId)
+ : undefined
+ }
);
@@ -341,8 +344,8 @@ class NonInjectedItemListLayoutContent<
return !isConfigurable || !tableId || !this.props.userStore.isTableColumnHidden(tableId, columnId, showWithColumn);
}
- renderColumnVisibilityMenu() {
- const { renderTableHeader = [], tableId } = this.props;
+ renderColumnVisibilityMenu(tableId: string) {
+ const { renderTableHeader = [] } = this.props;
return (
(
- !cellProps.showWithColumn && (
-
- )
+ .filter((props): props is TableCellProps & { id: string } => !!props.id)
+ .filter(props => !props.showWithColumn)
+ .map((cellProps) => (
+
))
}