Skip to content

Commit

Permalink
StartPageOptions: improve conditions to show modal only on a brand ne…
Browse files Browse the repository at this point in the history
…w page (#54245)

* StartPageOptions: improve conditions to show modal only on brand new page

* use isCleanNewPost
  • Loading branch information
jsnajdr authored Sep 8, 2023
1 parent 94f3641 commit ab97d28
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/edit-post/src/components/start-page-options/index.js
Original file line number Diff line number Diff line change
@@ -97,14 +97,13 @@ function StartPageOptionsModal() {

export default function StartPageOptions() {
const shouldEnableModal = useSelect( ( select ) => {
const { getEditedPostContent, isEditedPostSaveable } =
select( editorStore );
const { isCleanNewPost } = select( editorStore );
const { isEditingTemplate, isFeatureActive } = select( editPostStore );

return (
! isEditedPostSaveable() &&
'' === getEditedPostContent() &&
! isEditingTemplate() &&
! isFeatureActive( 'welcomeGuide' )
! isFeatureActive( 'welcomeGuide' ) &&
isCleanNewPost()
);
}, [] );

1 comment on commit ab97d28

@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 ab97d28.
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/6123973133
📝 Reported issues:

Please sign in to comment.