Skip to content

Commit

Permalink
Update 'isReady' condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jan 8, 2025
1 parent 5b395f0 commit 8b368fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(
mode,
defaultMode,
postTypeEntities,
hasLoadedPostObject,
} = useSelect(
( select ) => {
const {
Expand All @@ -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 ]
);
Expand All @@ -199,9 +198,8 @@ export const ExperimentalEditorProvider = withRegistryProvider(
: undefined;

return {
hasLoadedPostObject: _hasLoadedPostObject,
editorSettings: getEditorSettings(),
isReady: __unstableIsEditorReady(),
isReady: __unstableIsEditorReady() && hasLoadedPostObject,
mode: getRenderingMode(),
defaultMode:
hasTemplate && _defaultMode
Expand Down Expand Up @@ -342,7 +340,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
// Register the editor commands.
useCommands();

if ( ! isReady || ! mode || ! hasLoadedPostObject ) {
if ( ! isReady || ! mode ) {
return null;
}

Expand Down

0 comments on commit 8b368fc

Please sign in to comment.