Skip to content

Commit

Permalink
Code style: Collapse two filters into one
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Sep 21, 2021
1 parent d62f3bf commit 005fbfd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/edit-navigation/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ const batchSaveMenuItems = ( navigationBlock, menuId ) => async ( {
const batchInsertPlaceholderMenuItems = ( navigationBlock ) => async ( {
registry,
} ) => {
const blocksWithoutRecordId = blocksTreeToList( navigationBlock )
.filter( isBlockSupportedInNav )
.filter( ( block ) => ! getRecordIdFromBlock( block ) );
const blocksWithoutRecordId = blocksTreeToList( navigationBlock ).filter(
( block ) =>
isBlockSupportedInNav( block ) && ! getRecordIdFromBlock( block )
);

const tasks = blocksWithoutRecordId.map( () => ( { saveEntityRecord } ) =>
saveEntityRecord( 'root', 'menuItem', {
Expand Down

0 comments on commit 005fbfd

Please sign in to comment.