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 <ellatrix@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
  • Loading branch information
4 people committed Feb 13, 2024
1 parent faf81d8 commit 95d5ef7
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 95d5ef7

Please sign in to comment.