Skip to content

Commit

Permalink
Use Set.size
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Aug 17, 2022
1 parent de9aa2a commit ad02c59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export const BlockSwitcherDropdownMenu = ( { clientIds, blocks } ) => {
_icon = blockInformation?.icon; // Take into account active block variations.
} else {
const isSelectionOfSameType =
[ ...new Set( blocks.map( ( { name } ) => name ) ) ]
.length === 1;
new Set( blocks.map( ( { name } ) => name ) ).size === 1;
// When selection consists of blocks of multiple types, display an
// appropriate icon to communicate the non-uniformity.
_icon = isSelectionOfSameType
Expand Down

0 comments on commit ad02c59

Please sign in to comment.