Skip to content

Commit

Permalink
Fallback on falsy values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 12, 2024
1 parent dd643fe commit 3f047eb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3f047eb

Please sign in to comment.