Skip to content

Commit

Permalink
Inline Commenting: Disable comments on published posts for now (#66583)
Browse files Browse the repository at this point in the history
Co-authored-by: rinkalpagdar <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent b95553f commit f0ef1ac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export default function CollabSidebar() {
};
}, [] );

const postStatus = useSelect( ( select ) => {
const post = select( editorStore ).getCurrentPost();
return { postStatus: post?.status };
}, [] );

const threads = useSelect(
( select ) => {
if ( ! postId ) {
Expand Down Expand Up @@ -259,7 +264,10 @@ export default function CollabSidebar() {
}, [ postId, clientId ] );

// Check if the experimental flag is enabled.
if ( ! isBlockCommentExperimentEnabled ) {
if (
! isBlockCommentExperimentEnabled ||
postStatus.postStatus === 'publish'
) {
return null; // or maybe return some message indicating no threads are available.
}

Expand Down

1 comment on commit f0ef1ac

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in f0ef1ac.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11592581589
📝 Reported issues:

Please sign in to comment.