From 537c271b8a390c7bd7d609fe155a6abcd1b2f09a Mon Sep 17 00:00:00 2001 From: Ella Date: Mon, 5 Feb 2024 14:22:07 +0200 Subject: [PATCH] Fix selector --- .../src/components/provider/use-block-editor-settings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/components/provider/use-block-editor-settings.js b/packages/editor/src/components/provider/use-block-editor-settings.js index 81fc8b827bd477..dee5923c1a51ce 100644 --- a/packages/editor/src/components/provider/use-block-editor-settings.js +++ b/packages/editor/src/components/provider/use-block-editor-settings.js @@ -20,6 +20,9 @@ import inserterMediaCategories from '../media-categories'; import { mediaUpload } from '../../utils'; import { store as editorStore } from '../../store'; +const __experimentalSelectBlockPatterns = ( select ) => + select( coreStore ).getBlockPatterns(); + const EMPTY_BLOCKS_LIST = []; const BLOCK_EDITOR_SETTINGS = [ @@ -86,7 +89,6 @@ const BLOCK_EDITOR_SETTINGS = [ */ function useBlockEditorSettings( settings, postType, postId ) { const isLargeViewport = useViewportMatch( 'medium' ); - const { getBlockPatterns } = useSelect( coreStore ); const { allowRightClickOverrides, blockTypes, @@ -247,7 +249,7 @@ function useBlockEditorSettings( settings, postType, postId ) { keepCaretInsideBlock, mediaUpload: hasUploadPermissions ? mediaUpload : undefined, __experimentalBlockPatterns: blockPatterns, - __experimentalSelectBlockPatterns: getBlockPatterns, + __experimentalSelectBlockPatterns, __experimentalReusableBlocks: reusableBlocks, __experimentalBlockPatternCategories: blockPatternCategories, __experimentalUserPatternCategories: userPatternCategories, @@ -290,7 +292,6 @@ function useBlockEditorSettings( settings, postType, postId ) { reusableBlocks, userPatternCategories, blockPatterns, - getBlockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo,