Skip to content

Commit

Permalink
Replace isArray and length check with size in hiddenBlock lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
brentswisher committed Sep 11, 2019
1 parent 5c78b86 commit 617dd60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
findIndex,
flow,
groupBy,
isArray,
size,
isEmpty,
map,
some,
Expand Down Expand Up @@ -359,8 +359,8 @@ export class InserterMenu extends Component {
) }
{ isEmpty( suggestedItems ) && isEmpty( reusableItems ) && isEmpty( itemsPerCategory ) && (
<p className="editor-inserter__no-results block-editor-inserter__no-results">
{ numberOfHiddenBlocks ? __( 'No active blocks found.' ) : __( 'No blocks found.' ) }
{ !! numberOfHiddenBlocks && (
{ numberOfHiddenBlocks > 0 ? __( 'No active blocks found.' ) : __( 'No blocks found.' ) }
{ numberOfHiddenBlocks > 0 && (
<>
<br />
{
Expand Down Expand Up @@ -469,7 +469,7 @@ export default compose(
}
const destinationRootBlockName = getBlockName( destinationRootClientId );
const hiddenBlockTypes = getPreference( 'hiddenBlockTypes' );
const numberOfHiddenBlocks = isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;
const numberOfHiddenBlocks = size( hiddenBlockTypes );

return {
rootChildBlocks: getChildBlockNames( destinationRootBlockName ),
Expand Down

0 comments on commit 617dd60

Please sign in to comment.