Skip to content

Commit

Permalink
Update use-patterns.js
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Jul 17, 2023
1 parent 3bae60e commit 31e1f4d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ const selectThemePatterns = ( select, { categoryId, search = '' } = {} ) => {
item.categories?.includes( currentCategory ),
} );
} else {
// If there is no category id, select uncategorized patterns.
patterns = patterns.filter(
( item ) => ! item.hasOwnProperty( 'categories' )
);
patterns = searchItems( patterns, search, {
hasCategory: ( item ) => ! item.hasOwnProperty( 'categories' ),
} );
}

return { patterns, isResolving: false };
Expand Down

0 comments on commit 31e1f4d

Please sign in to comment.