@@ -69,22 +69,29 @@ export function Comments( {
6969 const { selectBlock, toggleBlockSpotlight } = unlock (
7070 useDispatch ( blockEditorStore )
7171 ) ;
72- const { blockCommentId, selectedBlockClientId, orderedBlockIds } =
73- useSelect ( ( select ) => {
74- const {
75- getBlockAttributes,
76- getSelectedBlockClientId,
77- getClientIdsWithDescendants,
78- } = select ( blockEditorStore ) ;
79- const clientId = getSelectedBlockClientId ( ) ;
80- return {
81- blockCommentId : clientId
82- ? getBlockAttributes ( clientId ) ?. metadata ?. noteId
83- : null ,
84- selectedBlockClientId : clientId ,
85- orderedBlockIds : getClientIdsWithDescendants ( ) ,
86- } ;
87- } , [ ] ) ;
72+
73+ const {
74+ blockCommentId,
75+ selectedBlockClientId,
76+ orderedBlockIds,
77+ blockMode,
78+ } = useSelect ( ( select ) => {
79+ const {
80+ getBlockAttributes,
81+ getSelectedBlockClientId,
82+ getClientIdsWithDescendants,
83+ getBlockMode,
84+ } = select ( blockEditorStore ) ;
85+ const clientId = getSelectedBlockClientId ( ) ;
86+ return {
87+ blockCommentId : clientId
88+ ? getBlockAttributes ( clientId ) ?. metadata ?. noteId
89+ : null ,
90+ selectedBlockClientId : clientId ,
91+ orderedBlockIds : getClientIdsWithDescendants ( ) ,
92+ blockMode : clientId ? getBlockMode ( clientId ) : null ,
93+ } ;
94+ } , [ ] ) ;
8895
8996 const relatedBlockElement = useBlockElement ( selectedBlockClientId ) ;
9097
@@ -311,6 +318,7 @@ export function Comments( {
311318 threads ,
312319 selectedThread ,
313320 setCanvasMinHeight ,
321+ blockMode ,
314322 ] ) ;
315323
316324 const handleThreadNavigation = ( event , thread , isSelected ) => {
0 commit comments