From e7fadf9c1bd7a674895b78ddfe208ceb8fe422ef Mon Sep 17 00:00:00 2001 From: Ella <4710635+ellatrix@users.noreply.github.com> Date: Mon, 12 Feb 2024 13:04:39 +0100 Subject: [PATCH] Site editor: fix start patterns store selector (#58813) Unlinked contributors: bgardner. Co-authored-by: ellatrix Co-authored-by: youknowriad Co-authored-by: colorful-tones --- .../src/components/start-template-options/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/edit-site/src/components/start-template-options/index.js b/packages/edit-site/src/components/start-template-options/index.js index 771f380db05a3..21e534499b8b5 100644 --- a/packages/edit-site/src/components/start-template-options/index.js +++ b/packages/edit-site/src/components/start-template-options/index.js @@ -4,10 +4,7 @@ import { Modal, Flex, FlexItem, Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { useState, useMemo } from '@wordpress/element'; -import { - __experimentalBlockPatternsList as BlockPatternsList, - store as blockEditorStore, -} from '@wordpress/block-editor'; +import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor'; import { useSelect } from '@wordpress/data'; import { useAsyncList } from '@wordpress/compose'; import { store as preferencesStore } from '@wordpress/preferences'; @@ -42,14 +39,13 @@ function useFallbackTemplateContent( slug, isCustom = false ) { function useStartPatterns( fallbackContent ) { const { slug, patterns } = useSelect( ( select ) => { const { getEditedPostType, getEditedPostId } = select( editSiteStore ); - const { getEntityRecord } = select( coreStore ); + const { getEntityRecord, getBlockPatterns } = select( coreStore ); const postId = getEditedPostId(); const postType = getEditedPostType(); const record = getEntityRecord( 'postType', postType, postId ); - const { getSettings } = select( blockEditorStore ); return { slug: record.slug, - patterns: getSettings().__experimentalBlockPatterns, + patterns: getBlockPatterns(), }; }, [] );