Skip to content

Commit

Permalink
Lodash: Remove _.pickBy() from template deletion (#46975)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Jan 10, 2023
1 parent 429a0c6 commit c44754a
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import { pickBy } from 'lodash';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -58,11 +53,10 @@ export default function DeleteTemplate() {
template: '',
} );
const settings = getEditorSettings();
const newAvailableTemplates = pickBy(
settings.availableTemplates,
( _title, id ) => {
return id !== template.slug;
}
const newAvailableTemplates = Object.fromEntries(
Object.entries( settings.availableTemplates ?? {} ).filter(
( [ id ] ) => id !== template.slug
)
);
updateEditorSettings( {
...settings,
Expand Down

1 comment on commit c44754a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in c44754a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3881249135
📝 Reported issues:

Please sign in to comment.