Skip to content

Commit

Permalink
Edit Site: Add template check to 'setPage' action (#38656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Feb 16, 2022
1 parent 5228628 commit 6057134
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/edit-site/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,17 @@ export function* setPage( page ) {

page.path = getPathAndQueryString( entity.link );
}
const { id: templateId, slug: templateSlug } = yield controls.resolveSelect(
const template = yield controls.resolveSelect(
coreStore,
'__experimentalGetTemplateForLink',
page.path
);

if ( ! template ) {
return;
}

const { id: templateId, slug: templateSlug } = template;
yield {
type: 'SET_PAGE',
page: ! templateSlug
Expand Down

0 comments on commit 6057134

Please sign in to comment.