Skip to content

Commit

Permalink
Filter out patterns that are not allowed in the inserter
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Jul 17, 2023
1 parent 5e44d3d commit ae58825
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const selectThemePatterns = ( select, { categoryId, search = '' } = {} ) => {
( pattern ) => ! CORE_PATTERN_SOURCES.includes( pattern.source )
)
.filter( filterOutDuplicatesByName )
.filter( ( pattern ) => pattern.inserter !== false )
.map( ( pattern ) => ( {
...pattern,
keywords: pattern.keywords || [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default function useThemePatterns() {
( pattern ) =>
! CORE_PATTERN_SOURCES.includes( pattern.source )
)
.filter( filterOutDuplicatesByName ),
.filter( filterOutDuplicatesByName )
.filter( ( pattern ) => pattern.inserter !== false ),
[ blockPatterns, restBlockPatterns ]
);

Expand Down

0 comments on commit ae58825

Please sign in to comment.