Skip to content

Commit

Permalink
Simplify selection
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Dec 2, 2024
1 parent c57ac63 commit f5731dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ function InserterMenu(
( select ) => unlock( select( blockEditorStore ) ).isZoomOut(),
[]
);
const hasSectionRootClientId = useSelect( ( select ) => {
const { getSectionRootClientId } = unlock( select( blockEditorStore ) );
const theRoot = getSectionRootClientId();
return theRoot?.length > 0;
}, [] );
const hasSectionRootClientId = useSelect(
( select ) =>
!! unlock( select( blockEditorStore ) ).getSectionRootClientId(),
[]
);
const [ filterValue, setFilterValue, delayedFilterValue ] =
useDebouncedInput( __experimentalFilterValue );
const [ hoveredItem, setHoveredItem ] = useState( null );
Expand Down
10 changes: 5 additions & 5 deletions packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ function Header( {
( ! hasBlockSelection || isBlockToolsCollapsed ) ) );
const hasBackButton = useHasBackButton();

const hasSectionRootClientId = useSelect( ( select ) => {
const { getSectionRootClientId } = unlock( select( blockEditorStore ) );
const theRoot = getSectionRootClientId();
return theRoot?.length > 0;
}, [] );
const hasSectionRootClientId = useSelect(
( select ) =>
!! unlock( select( blockEditorStore ) ).getSectionRootClientId(),
[]
);

/*
* The edit-post-header classname is only kept for backward compatability
Expand Down

0 comments on commit f5731dc

Please sign in to comment.