From 534345ae0824048b4dd884ca7148f2d4ebeb3ae7 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Thu, 1 Aug 2024 12:37:32 -0500 Subject: [PATCH] =?UTF-8?q?Revert=20"Remove=20unnecessary/incorrect=20`unl?= =?UTF-8?q?ock`=20call=20in=20`setEditorMode`=20action=20=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9186964684888b8385bdee11cb1c6dbcafedf8f2. --- packages/block-editor/src/store/actions.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 3a209a1267e288..f7da8fa14b382a 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -35,6 +35,7 @@ import { privateRemoveBlocks, } from './private-actions'; import { STORE_NAME } from './constants'; +import { unlock } from '../lock-unlock'; /** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */ @@ -1673,9 +1674,9 @@ export const __unstableSetEditorMode = // When switching to zoom-out mode, we need to select the parent section if ( mode === 'zoom-out' ) { const firstSelectedClientId = select.getBlockSelectionStart(); - const { sectionRootClientId } = registry - .select( STORE_NAME ) - .getSettings(); + const { sectionRootClientId } = unlock( + registry.select( STORE_NAME ).getSettings() + ); if ( firstSelectedClientId ) { let sectionClientId;