From c1356cd33bf347758875beaacb04983c629b22f4 Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 16 May 2024 14:35:19 +0900 Subject: [PATCH] Fix for site editor --- .../src/components/inserter-sidebar/index.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/editor/src/components/inserter-sidebar/index.js b/packages/editor/src/components/inserter-sidebar/index.js index cd45d101f187a3..04a73c91e92211 100644 --- a/packages/editor/src/components/inserter-sidebar/index.js +++ b/packages/editor/src/components/inserter-sidebar/index.js @@ -30,23 +30,14 @@ export default function InserterSidebar( { const { getInserterSidebarToggleRef, getInsertionPoint } = unlock( select( editorStore ) ); - const { getBlockRootClientId, __unstableGetEditorMode, getSettings } = - select( blockEditorStore ); + const { getSettings } = select( blockEditorStore ); const { get } = select( preferencesStore ); - const getBlockSectionRootClientId = () => { - if ( __unstableGetEditorMode() === 'zoom-out' ) { - const { sectionRootClientId } = unlock( getSettings() ); - if ( sectionRootClientId ) { - return sectionRootClientId; - } - } - return getBlockRootClientId(); - }; + const { sectionRootClientId } = unlock( getSettings() ); return { inserterSidebarToggleRef: getInserterSidebarToggleRef(), insertionPoint: getInsertionPoint(), showMostUsedBlocks: get( 'core', 'mostUsedBlocks' ), - blockSectionRootClientId: getBlockSectionRootClientId(), + blockSectionRootClientId: sectionRootClientId ?? '', }; }, [] ); const { setIsInserterOpened } = useDispatch( editorStore ); @@ -79,7 +70,7 @@ export default function InserterSidebar( { showInserterHelpPanel shouldFocusBlock={ isMobileViewport } rootClientId={ - blockSectionRootClientId ?? insertionPoint.rootClientId + insertionPoint.rootClientId ?? blockSectionRootClientId } __experimentalInsertionIndex={ insertionPoint.insertionIndex