Skip to content

Commit

Permalink
Fix for site editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed May 16, 2024
1 parent 6c682b8 commit c1356cd
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/editor/src/components/inserter-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -79,7 +70,7 @@ export default function InserterSidebar( {
showInserterHelpPanel
shouldFocusBlock={ isMobileViewport }
rootClientId={
blockSectionRootClientId ?? insertionPoint.rootClientId
insertionPoint.rootClientId ?? blockSectionRootClientId
}
__experimentalInsertionIndex={
insertionPoint.insertionIndex
Expand Down

0 comments on commit c1356cd

Please sign in to comment.