From 581d3cc750db5f3990683d266487d5de73867d9a Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Wed, 13 Nov 2024 03:45:15 -0300 Subject: [PATCH] Fix uncategorized pattern browsing when pattern has no categories (#66945) Co-authored-by: matiasbenedetto Co-authored-by: ramonjd Co-authored-by: Mamaduka Co-authored-by: getdave --- .../inserter/block-patterns-explorer/pattern-list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js b/packages/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js index 709e005b587cea..d7f0aadb0e7436 100644 --- a/packages/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js +++ b/packages/block-editor/src/components/inserter/block-patterns-explorer/pattern-list.js @@ -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; }