Skip to content

Commit

Permalink
Hide edit button from non-automenus
Browse files Browse the repository at this point in the history
  • Loading branch information
George Hotelling authored and getdave committed Nov 16, 2022
1 parent d28f90f commit 36779e1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ const BlockEditButton = ( { label, clientId } ) => {
const { toggleBlockHighlight } = useDispatch( blockEditorStore );
const [ convertModalOpen, setConvertModalOpen ] = useState( false );
const { totalPages } = usePageData();
const allowConvertToLinks = totalPages <= MAX_PAGE_COUNT;

const block = useSelect(
( select ) => {
Expand All @@ -202,11 +201,12 @@ const BlockEditButton = ( { label, clientId } ) => {

const onClick = () => {
toggleBlockHighlight( clientId, true );
if ( 'core/page-list' === block.name ) {
setConvertModalOpen( ! convertModalOpen );
}
setConvertModalOpen( ! convertModalOpen );
};

const allowConvertToLinks =
'core/page-list' === block.name && totalPages <= MAX_PAGE_COUNT;

return (
<>
{ convertModalOpen && (
Expand Down

0 comments on commit 36779e1

Please sign in to comment.