Skip to content

Commit

Permalink
Site editor: fix start patterns store selector (#58813)
Browse files Browse the repository at this point in the history
Unlinked contributors: bgardner.

Co-authored-by: ellatrix <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: colorful-tones <[email protected]>
  • Loading branch information
4 people committed Feb 13, 2024
1 parent 1adfe8d commit 924b0f1
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(),
};
}, [] );

Expand Down

0 comments on commit 924b0f1

Please sign in to comment.