Skip to content

Commit

Permalink
Fix for site editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and scruffian committed Aug 1, 2024
1 parent 6cbaf0f commit 0ed4d3e
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 @@ -33,27 +33,18 @@ export default function InserterSidebar() {
getInsertionPoint,
isPublishSidebarOpened,
} = unlock( select( editorStore ) );
const { getBlockRootClientId, __unstableGetEditorMode, getSettings } =
select( blockEditorStore );
const { getSettings } = select( blockEditorStore );
const { get } = select( preferencesStore );
const { getActiveComplementaryArea } = select( interfaceStore );
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(),
sidebarIsOpened: !! (
getActiveComplementaryArea( 'core' ) || isPublishSidebarOpened()
),
blockSectionRootClientId: sectionRootClientId ?? '',
};
}, [] );
const { setIsInserterOpened } = useDispatch( editorStore );
Expand Down Expand Up @@ -85,7 +76,7 @@ export default function InserterSidebar() {
showInserterHelpPanel
shouldFocusBlock={ isMobileViewport }
rootClientId={
blockSectionRootClientId ?? insertionPoint.rootClientId
insertionPoint.rootClientId ?? blockSectionRootClientId
}
__experimentalInsertionIndex={ insertionPoint.insertionIndex }
onSelect={ insertionPoint.onSelect }
Expand Down

0 comments on commit 0ed4d3e

Please sign in to comment.