Skip to content

Commit

Permalink
Inline Commenting: Disable comments on published posts for now (WordP…
Browse files Browse the repository at this point in the history
…ress#66583)


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

0 comments on commit f0ef1ac

Please sign in to comment.