From 80a6026970853f726756fbc8c5b4eca79a1c31f6 Mon Sep 17 00:00:00 2001 From: ramon Date: Tue, 3 Sep 2024 09:56:50 +1000 Subject: [PATCH] Simplify condition --- packages/block-editor/src/components/block-switcher/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-editor/src/components/block-switcher/index.js b/packages/block-editor/src/components/block-switcher/index.js index 982b6e80792d7b..610f2c0580b5b7 100644 --- a/packages/block-editor/src/components/block-switcher/index.js +++ b/packages/block-editor/src/components/block-switcher/index.js @@ -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;