Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd authored and getdave committed Sep 6, 2024
1 parent 68c05cf commit 80a6026
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
} else {
const isSelectionOfSameType =
new Set( _blocks.map( ( { name } ) => name ) ).size === 1;
_hasTemplateLock = clientIds.some(
( id ) => getTemplateLock( id ) === 'contentOnly'
);
// When selection consists of blocks of multiple types, display an
// appropriate icon to communicate the non-uniformity.
_icon = isSelectionOfSameType ? blockType.icon : copy;
Expand Down

0 comments on commit 80a6026

Please sign in to comment.