Skip to content

Commit

Permalink
review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed May 28, 2024
1 parent 758d138 commit d664269
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/data-table/ha-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,10 @@ export class HaDataTable extends LitElement {
}

public collapseAllGroups() {
if (!this.groupColumn) {
if (
!this.groupColumn ||
!this.data.some((item) => item[this.groupColumn!])
) {
return;
}
const grouped = groupBy(this.data, (item) => item[this.groupColumn!]);
Expand Down

0 comments on commit d664269

Please sign in to comment.