From 89572a8a78612ba484939688fe62854d89fc1b8f Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Mon, 16 Sep 2024 15:23:22 +0100 Subject: [PATCH] Allow finding appropriate route even outside zoom out mode --- .../src/components/inserter-sidebar/index.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/editor/src/components/inserter-sidebar/index.js b/packages/editor/src/components/inserter-sidebar/index.js index 30df2d0dc6257..40a6f6dcf0808 100644 --- a/packages/editor/src/components/inserter-sidebar/index.js +++ b/packages/editor/src/components/inserter-sidebar/index.js @@ -34,22 +34,19 @@ export default function InserterSidebar() { isPublishSidebarOpened, } = unlock( select( editorStore ) ); - const { - getBlockRootClientId, - __unstableGetEditorMode, - getSectionRootClientId, - } = unlock( select( blockEditorStore ) ); + const { getBlockRootClientId, getSectionRootClientId } = unlock( + select( blockEditorStore ) + ); const { get } = select( preferencesStore ); const { getActiveComplementaryArea } = select( interfaceStore ); const getBlockSectionRootClientId = () => { - if ( __unstableGetEditorMode() === 'zoom-out' ) { - const sectionRootClientId = getSectionRootClientId(); + const sectionRootClientId = getSectionRootClientId(); - if ( sectionRootClientId ) { - return sectionRootClientId; - } + if ( sectionRootClientId ) { + return sectionRootClientId; } + return getBlockRootClientId(); }; return {