Skip to content

Commit ca0188f

Browse files
rinkalpagdarrinkalpagdarMamaduka
authored andcommitted
Inline Commenting: Disable comments on published posts for now (WordPress#66583)
Co-authored-by: rinkalpagdar <rinkalpagdar@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
1 parent db7e33f commit ca0188f

File tree

1 file changed

+9
-1
lines changed
  • packages/editor/src/components/collab-sidebar

1 file changed

+9
-1
lines changed

packages/editor/src/components/collab-sidebar/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export default function CollabSidebar() {
6262
};
6363
}, [] );
6464

65+
const postStatus = useSelect( ( select ) => {
66+
const post = select( editorStore ).getCurrentPost();
67+
return { postStatus: post?.status };
68+
}, [] );
69+
6570
const threads = useSelect(
6671
( select ) => {
6772
if ( ! postId ) {
@@ -259,7 +264,10 @@ export default function CollabSidebar() {
259264
}, [ postId, clientId ] );
260265

261266
// Check if the experimental flag is enabled.
262-
if ( ! isBlockCommentExperimentEnabled ) {
267+
if (
268+
! isBlockCommentExperimentEnabled ||
269+
postStatus.postStatus === 'publish'
270+
) {
263271
return null; // or maybe return some message indicating no threads are available.
264272
}
265273

0 commit comments

Comments
 (0)