Skip to content

Commit

Permalink
Update packages/editor/src/components/post-actions/actions.js
Browse files Browse the repository at this point in the history
Co-authored-by: Aki Hamano <[email protected]>
  • Loading branch information
mikachan and t-hamano authored Dec 10, 2024
1 parent 2cc8058 commit 61c7d48
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ export function usePostActions( { postType, onActionPerformed, context } ) {
}

// Ensure "Move to trash" is always the last action.
actions = actions.sort( ( a, b ) => {
if ( b.id === 'move-to-trash' ) {
return -1;
}
return 0;
} );
actions = actions.sort( ( a, b ) =>
b.id === 'move-to-trash' ? -1 : 0
);

// Filter actions based on provided context. If not provided
// all actions are returned. We'll have a single entry for getting the actions
Expand Down

0 comments on commit 61c7d48

Please sign in to comment.