Skip to content

Commit

Permalink
Read record type only if edited entity hook says it’s loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Sep 3, 2024
1 parent d23d85c commit 29bfbc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/edit-site/src/components/welcome-guide/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import useEditedEntityRecord from '../use-edited-entity-record';
export default function WelcomeGuideTemplate() {
const { toggle } = useDispatch( preferencesStore );

const edited = useEditedEntityRecord();
const isPostTypeTemplate = edited.record.type === 'wp_template';
const { isLoaded, record } = useEditedEntityRecord();
const isPostTypeTemplate = isLoaded && record.type === 'wp_template';
const { isActive, hasPreviousEntity } = useSelect( ( select ) => {
const { getEditorSettings } = select( editorStore );
const { get } = select( preferencesStore );
Expand Down

0 comments on commit 29bfbc0

Please sign in to comment.