Skip to content

Commit

Permalink
Query Loop: Check for postTypeFromContext before using it (#66655)
Browse files Browse the repository at this point in the history
Co-authored-by: mikachan <mikachan@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 489f606 commit 2f088e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-template/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default function PostTemplateEdit( {
// When we preview Query Loop blocks we should prefer the current
// block's postType, which is passed through block context.
const usedPostType =
postTypeFromContext !== 'page'
postTypeFromContext && postTypeFromContext !== 'page'
? postTypeFromContext
: previewPostType || postType;
return {
Expand Down

1 comment on commit 2f088e4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 2f088e4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11619147995
📝 Reported issues:

Please sign in to comment.