From 8b368fc2fe32517d2b259840b9e8d2df5c312c6d Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 8 Jan 2025 17:34:23 +0400 Subject: [PATCH] Update 'isReady' condition --- packages/editor/src/components/provider/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index 59767aba750a32..a3f2eabdcb13c7 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -171,7 +171,6 @@ export const ExperimentalEditorProvider = withRegistryProvider( mode, defaultMode, postTypeEntities, - hasLoadedPostObject, } = useSelect( ( select ) => { const { @@ -187,7 +186,7 @@ export const ExperimentalEditorProvider = withRegistryProvider( } = select( coreStore ); const postTypeSupports = getPostType( post.type )?.supports; - const _hasLoadedPostObject = hasFinishedResolution( + const hasLoadedPostObject = hasFinishedResolution( 'getPostType', [ post.type ] ); @@ -199,9 +198,8 @@ export const ExperimentalEditorProvider = withRegistryProvider( : undefined; return { - hasLoadedPostObject: _hasLoadedPostObject, editorSettings: getEditorSettings(), - isReady: __unstableIsEditorReady(), + isReady: __unstableIsEditorReady() && hasLoadedPostObject, mode: getRenderingMode(), defaultMode: hasTemplate && _defaultMode @@ -342,7 +340,7 @@ export const ExperimentalEditorProvider = withRegistryProvider( // Register the editor commands. useCommands(); - if ( ! isReady || ! mode || ! hasLoadedPostObject ) { + if ( ! isReady || ! mode ) { return null; }