Skip to content

Commit

Permalink
Relocate some checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Feb 17, 2025
1 parent 3dab7f3 commit e9bced2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,14 @@ export const ExperimentalEditorProvider = withRegistryProvider(
const hasDefaultMode = RENDERING_MODES.includes( _defaultMode );

// Wait for template resolution when rendering in a `template-locked` mode.
const canRenderDefaultMode =
_defaultMode === 'template-locked' ? hasTemplate : true;
const hasResolvedMode =
hasLoadedPostObject && _defaultMode === 'template-locked'
? hasTemplate
: true;

return {
editorSettings: getEditorSettings(),
isReady:
__unstableIsEditorReady() &&
hasLoadedPostObject &&
canRenderDefaultMode,
isReady: __unstableIsEditorReady() && hasResolvedMode,
mode: getRenderingMode(),
defaultMode: hasDefaultMode ? _defaultMode : 'post-only',
selection: getEditorSelection(),
Expand Down

0 comments on commit e9bced2

Please sign in to comment.