Skip to content

Commit

Permalink
fix coding standard warnings and error
Browse files Browse the repository at this point in the history
  • Loading branch information
rishishah-multidots committed Oct 17, 2024
1 parent 13f53d8 commit 4d0ca6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function CollabSidebar() {
const { getEntityRecords } = resolveSelect( coreStore );

// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { openGeneralSidebar } = useDispatch( 'core/edit-post' );
const { openGeneralSidebar } = useDispatch( editorStore );
const [ blockCommentID, setBlockCommentID ] = useState( null );
const [ showCommentBoard, setShowCommentBoard ] = useState( false );

Expand Down
16 changes: 16 additions & 0 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ import {
getNotificationArgumentsForSaveFail,
getNotificationArgumentsForTrashFail,
} from './utils/notice-builder';
import { privateApis as editorPrivateApis } from '../private-apis';
import { unlock } from '../lock-unlock';

const { interfaceStore } = unlock( editorPrivateApis );
/**
* Returns an action generator used in signalling that editor has initialized with
* the specified post object and editor settings.
Expand Down Expand Up @@ -192,6 +195,19 @@ export const editPost =
.editEntityRecord( 'postType', type, id, edits, options );
};

/**
* Action that opens an editor sidebar.
*
* @param {?string} name Sidebar name to be opened.
*/
export const openGeneralSidebar =
( name ) =>
( { registry } ) => {
registry
.dispatch( interfaceStore )
.enableComplementaryArea( 'core', name );
};

/**
* Action for saving the current post in the editor.
*
Expand Down

0 comments on commit 4d0ca6e

Please sign in to comment.