diff --git a/packages/editor/src/components/preferences-modal/index.js b/packages/editor/src/components/preferences-modal/index.js index 36ed1f0eee835a..a8cfd8245522cd 100644 --- a/packages/editor/src/components/preferences-modal/index.js +++ b/packages/editor/src/components/preferences-modal/index.js @@ -11,7 +11,6 @@ import { privateApis as preferencesPrivateApis, } from '@wordpress/preferences'; import { store as interfaceStore } from '@wordpress/interface'; -import { store as blockEditorStore } from '@wordpress/block-editor'; /** * Internal dependencies @@ -27,6 +26,7 @@ import PageAttributesCheck from '../page-attributes/check'; import PostTypeSupportCheck from '../post-type-support-check'; import { store as editorStore } from '../../store'; import { unlock } from '../../lock-unlock'; +import { useStartPatterns } from '../start-page-options'; const { PreferencesModal, @@ -35,17 +35,6 @@ const { PreferenceToggleControl, } = unlock( preferencesPrivateApis ); -function useStartPatterns() { - // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes, - // and it has no postTypes declared and the current post type is page or if - // the current post type is part of the postTypes declared. - return useSelect( ( select ) => - select( blockEditorStore ).getPatternsByBlockTypes( - 'core/post-content' - ) - ); -} - export default function EditorPreferencesModal( { extraSections = {} } ) { const isLargeViewport = useViewportMatch( 'medium' ); const { isActive, showBlockBreadcrumbsOption } = useSelect(