Skip to content

Commit

Permalink
Remove redunant selector call
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 19, 2024
1 parent 89572a8 commit 66ba934
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/editor/src/components/inserter-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,17 @@ export default function InserterSidebar() {
isPublishSidebarOpened,
} = unlock( select( editorStore ) );

const { getBlockRootClientId, getSectionRootClientId } = unlock(
select( blockEditorStore )
);
const { getSectionRootClientId } = unlock( select( blockEditorStore ) );
const { get } = select( preferencesStore );
const { getActiveComplementaryArea } = select( interfaceStore );

const getBlockSectionRootClientId = () => {
const sectionRootClientId = getSectionRootClientId();

if ( sectionRootClientId ) {
return sectionRootClientId;
}

return getBlockRootClientId();
// '' is equiavlent to calling getBlockRootClientId() with no arguments.
return sectionRootClientId ?? '';
};

return {
inserterSidebarToggleRef: getInserterSidebarToggleRef(),
insertionPoint: getInsertionPoint(),
Expand Down

0 comments on commit 66ba934

Please sign in to comment.