diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index 68d7bd1d3f4f5b..2b171e1d900ff6 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -180,23 +180,25 @@ export const ExperimentalEditorProvider = withRegistryProvider( getRenderingMode, __unstableIsEditorReady, } = select( editorStore ); - const { getEntitiesConfig } = select( coreStore ); + const { + getEntitiesConfig, + getPostType, + hasFinishedResolution, + } = select( coreStore ); - const postTypeObject = select( coreStore ).getPostType( - post.type + const postTypeObject = getPostType( post.type ); + const _hasLoadedPostObject = hasFinishedResolution( + 'getPostType', + [ post.type ] ); - const _hasLoadedPostObject = select( - coreStore - ).hasFinishedResolution( 'getPostType', [ post.type ] ); - return { hasLoadedPostObject: _hasLoadedPostObject, editorSettings: getEditorSettings(), isReady: __unstableIsEditorReady(), mode: getRenderingMode(), defaultMode: - postTypeObject?.default_rendering_mode ?? 'post-only', + postTypeObject?.default_rendering_mode || 'post-only', selection: getEditorSelection(), postTypeEntities: post.type === 'wp_template'