Skip to content

Commit

Permalink
Allow finding appropriate route even outside zoom out mode
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 19, 2024
1 parent eff19e0 commit 89572a8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/editor/src/components/inserter-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 89572a8

Please sign in to comment.