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 Nov 13, 2024
1 parent 0a5e54a commit 538f03d
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

1 comment on commit 538f03d

@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 538f03d.
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/11812067879
📝 Reported issues:

Please sign in to comment.