Skip to content

Commit

Permalink
Linting issues updated
Browse files Browse the repository at this point in the history
  • Loading branch information
karthick-murugan committed Dec 18, 2024
1 parent 79aa8ad commit 41f34a4
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/editor/src/components/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
external,
keyboard,
symbol,
page,
layout,
rotateRight,
rotateLeft,
Expand Down Expand Up @@ -468,25 +467,26 @@ const getManipulateDocumentCommands = () =>
};
};

function useSiteEditorCommandLoader() {
const commands = [];
commands.push( {
name: 'core/drafts',
label: __( 'Pages/Drafts' ),
keywords: [ 'drafts' ],
icon: page,
callback: ( { close } ) => {
close();
window.location.href =
'/wp-admin/site-editor.php?postType=page&layout=list&activeView=drafts';
},
} );
const getuseSiteEditorCommandLoader = () =>
function useSiteEditorCommandLoader() {
const commands = [];
commands.push( {
name: 'core/drafts',
label: __( 'Pages/Drafts' ),
keywords: [ 'drafts' ],
icon: page,
callback: ( { close } ) => {
close();
window.location.href =
'/wp-admin/site-editor.php?postType=page&layout=list&activeView=drafts';
},
} );

return {
commands,
isLoading: false,
return {
commands,
isLoading: false,
};
};
}

export default function useCommands() {
useCommandLoader( {
Expand All @@ -502,11 +502,11 @@ export default function useCommands() {

useCommandLoader( {
name: 'core/editor/site-editor',
hook: useSiteEditorCommandLoader,
hook: getuseSiteEditorCommandLoader(),
context: 'site-editor',
} );
useCommandLoader( {

useCommandLoader( {
name: 'core/editor/page-content-focus',
hook: getPageContentFocusCommands(),
context: 'entity-edit',
Expand Down

0 comments on commit 41f34a4

Please sign in to comment.