Skip to content

Commit

Permalink
Avoid multiple calls to getBlockEditingMode()
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Jan 31, 2024
1 parent bf845d3 commit fc1f606
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ function BlockListBlockProvider( props ) {
isBlockBeingDragged,
hasBlockMovingClientId,
canInsertBlockType,
getBlockRootClientId,
__unstableHasActiveBlockOverlayActive,
__unstableGetEditorMode,
getSelectedBlocksInitialCaretPosition,
Expand Down Expand Up @@ -556,6 +555,7 @@ function BlockListBlockProvider( props ) {
const hasLightBlockWrapper = blockType?.apiVersion > 1;
const movingClientId = hasBlockMovingClientId();
const blockEditingMode = getBlockEditingMode( clientId );

return {
mode: getBlockMode( clientId ),
isSelectionEnabled: isSelectionEnabled(),
Expand Down Expand Up @@ -614,7 +614,7 @@ function BlockListBlockProvider( props ) {
movingClientId &&
canInsertBlockType(
getBlockName( movingClientId ),
getBlockRootClientId( clientId )
rootClientId
),
isEditingDisabled: blockEditingMode === 'disabled',
hasEditableOutline:
Expand Down

0 comments on commit fc1f606

Please sign in to comment.