Skip to content

Commit

Permalink
Include template when not in legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Jun 22, 2022
1 parent b7cbf97 commit 7f011ec
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/block-library/src/comments/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
*/
import CommentsInspectorControls from './comments-inspector-controls';
import Placeholder from './placeholder';
import TEMPLATE from './template';

export default function PostCommentsEdit( {
attributes,
setAttributes,
context: { postType, postId },
clientId,
} ) {
const { tagName: TagName, textAlign } = attributes;

Expand All @@ -45,10 +45,6 @@ export default function PostCommentsEdit( {
.__experimentalDiscussionSettings
);

const innerBlocks = useSelect( ( select ) =>
select( blockEditorStore ).getBlocks( clientId )
);

const isSiteEditor = postType === undefined || postId === undefined;

const postTypeSupportsComments = useSelect( ( select ) =>
Expand Down Expand Up @@ -92,9 +88,11 @@ export default function PostCommentsEdit( {
[ `has-text-align-${ textAlign }` ]: textAlign,
} ),
} );
const innerBlocksProps = useInnerBlocksProps( blockProps );
const innerBlocksProps = useInnerBlocksProps( blockProps, {
template: TEMPLATE,
} );

if ( innerBlocks.length > 0 ) {
if ( ! attributes.legacy ) {
return (
<>
<CommentsInspectorControls
Expand Down

0 comments on commit 7f011ec

Please sign in to comment.