Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Feb 4, 2021
1 parent dfd4e7d commit 7847e86
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export const createGridColumns = (
return { rowValue, contentsIsDefined, cellContent };
};

const visibleColumnsCount = columnConfig.columns.filter((c) => !c.hidden).length;

return visibleColumns.map((field) => {
const filterable = bucketLookup.has(field);
const { name, index: colIndex } = columnsReverseLookup[field];
Expand Down Expand Up @@ -187,7 +185,7 @@ export const createGridColumns = (
defaultMessage: 'Hide',
}),
'data-test-subj': 'lensDatatableHide',
isDisabled: !isHidden && visibleColumnsCount <= 1,
isDisabled: !isHidden && visibleColumns.length <= 1,
},
],
},
Expand Down

0 comments on commit 7847e86

Please sign in to comment.