Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrico committed Jul 5, 2024
1 parent 642fccd commit 913ff90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/blocks/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ export function categories( state = DEFAULT_CATEGORIES, action ) {
switch ( action.type ) {
case 'SET_CATEGORIES':
// Ensure, that categories are unique by slug.
const categories = new Map();
(action.categories || []).forEach( (category) => {
categories.set(category.slug, category);
});
return [...categories.values()];
const uniqueCategories = new Map();
( action.categories || [] ).forEach( ( category ) => {
uniqueCategories.set( category.slug, category );
} );
return [ ...uniqueCategories.values() ];
case 'UPDATE_CATEGORY': {
if (
! action.category ||
Expand Down

0 comments on commit 913ff90

Please sign in to comment.