Skip to content

Commit 9f65fac

Browse files
committed
trial: remove double sidebars & use just one to see if the issue is fixed
1 parent 0d75f88 commit 9f65fac

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export const collabHistorySidebarName = 'edit-post/collab-history-sidebar';
21
export const collabSidebarName = 'edit-post/collab-sidebar';

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

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { store as interfaceStore } from '@wordpress/interface';
2020
* Internal dependencies
2121
*/
2222
import PluginSidebar from '../plugin-sidebar';
23-
import { collabHistorySidebarName, collabSidebarName } from './constants';
23+
import { collabSidebarName } from './constants';
2424
import { Comments } from './comments';
2525
import { AddComment } from './add-comment';
2626
import { store as editorStore } from '../../store';
@@ -257,7 +257,7 @@ export default function CollabSidebar() {
257257

258258
const openCollabBoard = () => {
259259
setShowCommentBoard( true );
260-
enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
260+
enableComplementaryArea( 'core', collabSidebarName );
261261
};
262262

263263
const [ blocks ] = useEntityBlockEditor( 'postType', postType, {
@@ -339,26 +339,18 @@ export default function CollabSidebar() {
339339
<>
340340
<AddCommentComponent onClick={ openCollabBoard } />
341341
<PluginSidebar
342-
identifier={ collabHistorySidebarName }
343-
// translators: Comments sidebar title
344-
title={ __( 'Comments' ) }
345-
icon={ commentIcon }
346-
>
347-
<CollabSidebarContent
348-
comments={ resultComments }
349-
showCommentBoard={ showCommentBoard }
350-
setShowCommentBoard={ setShowCommentBoard }
351-
/>
352-
</PluginSidebar>
353-
<PluginSidebar
354-
isPinnable={ false }
355-
header={ false }
342+
isPinnable
356343
identifier={ collabSidebarName }
357344
className="editor-collab-sidebar"
358345
headerClassName="editor-collab-sidebar__header"
346+
// translators: Comments sidebar title
347+
title={ __( 'Comments' ) }
348+
icon={ commentIcon }
359349
>
360350
<CollabSidebarContent
361-
comments={ sortedThreads }
351+
comments={
352+
showCommentBoard ? sortedThreads : resultComments
353+
}
362354
showCommentBoard={ showCommentBoard }
363355
setShowCommentBoard={ setShowCommentBoard }
364356
styles={ {

0 commit comments

Comments
 (0)