Skip to content

Commit

Permalink
Hide page list edit button if no pages available (#46331)
Browse files Browse the repository at this point in the history
* hides page list edit button if no pages avaulable

* Don't output BlockControls if there are no pages

Co-authored-by: Andrei Draganescu <[email protected]>
Co-authored-by: Ben Dwyer <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2022
1 parent 650626a commit 946f1be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/page-list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function PageListEdit( {
/>
</PanelBody>
</InspectorControls>
{ allowConvertToLinks && (
{ allowConvertToLinks && totalPages > 0 && (
<BlockControls group="other">
<ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
{ __( 'Edit' ) }
Expand Down

0 comments on commit 946f1be

Please sign in to comment.