Skip to content

Commit

Permalink
Tidy up edit mode assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz authored and talldan committed Jan 3, 2024
1 parent 638e0d2 commit f0c08de
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ function getOverridesFromBlocks( blocks, defaultValues ) {

function setBlockEditMode( setEditMode, blocks, mode ) {
blocks.forEach( ( block ) => {
let editMode = mode;
if ( ! editMode ) {
editMode = isPartiallySynced( block ) ? 'contentOnly' : 'disabled';
}
const editMode =
mode || ( isPartiallySynced( block ) ? 'contentOnly' : 'disabled' );
setEditMode( block.clientId, editMode );
setBlockEditMode( setEditMode, block.innerBlocks, mode );
} );
Expand Down

0 comments on commit f0c08de

Please sign in to comment.