Skip to content

Commit

Permalink
Remove unnecessary label when no visisble filters exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Nov 3, 2023
1 parent 6f46fe8 commit 8e1a28d
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions packages/edit-site/src/components/dataviews/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,24 @@ export default function Filters( { fields, view, onChangeView } ) {
} );
} );

return (
view.visibleFilters?.map( ( filterName ) => {
const filter = filterIndex[ filterName ];
return view.visibleFilters?.map( ( filterName ) => {
const filter = filterIndex[ filterName ];

if ( ! filter ) {
return null;
}
if ( ! filter ) {
return null;
}

if ( filter.type === 'enumeration' ) {
return (
<InFilter
key={ filterName }
filter={ filter }
view={ view }
onChangeView={ onChangeView }
/>
);
}
if ( filter.type === 'enumeration' ) {
return (
<InFilter
key={ filterName }
filter={ filter }
view={ view }
onChangeView={ onChangeView }
/>
);
}

return null;
} ) || __( 'No filters available' )
);
return null;
} );
}

0 comments on commit 8e1a28d

Please sign in to comment.