Skip to content

Commit

Permalink
Fix uncategorized pattern browsing when pattern has no categories (#6…
Browse files Browse the repository at this point in the history
…6945)


Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
  • Loading branch information
5 people authored and cbravobernal committed Nov 19, 2024
1 parent da80430 commit 581d3cc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function PatternList( {
return true;
}
if ( selectedCategory === 'uncategorized' ) {
const hasKnownCategory = pattern.categories.some(
( category ) =>
const hasKnownCategory =
pattern.categories?.some( ( category ) =>
registeredPatternCategories.includes( category )
);
) ?? false;

return ! pattern.categories?.length || ! hasKnownCategory;
}
Expand Down

0 comments on commit 581d3cc

Please sign in to comment.