From 57183deb7dccd79f35e68b3468ebb62695fd41ae Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 4 Sep 2024 15:12:30 +1000 Subject: [PATCH] Return an empty array from the memoized value of useStartPatterns() so that the preferences modal has a value to test. --- .../editor/src/components/start-page-options/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/start-page-options/index.js b/packages/editor/src/components/start-page-options/index.js index fcae88d7588bb9..1c13ba6bbcc5da 100644 --- a/packages/editor/src/components/start-page-options/index.js +++ b/packages/editor/src/components/start-page-options/index.js @@ -52,8 +52,14 @@ export function useStartPatterns() { ); return useMemo( () => { - // filter patterns without postTypes declared if the current postType is page - // or patterns that declare the current postType in its post type array. + if ( ! blockPatternsWithPostContentBlockType?.length ) { + return []; + } + + /* + * Filter patterns without postTypes declared if the current postType is page + * or patterns that declare the current postType in its post type array. + */ return blockPatternsWithPostContentBlockType.filter( ( pattern ) => { return ( ( postType === 'page' && ! pattern.postTypes ) ||