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 (WordPress#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
Expand Up @@ -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()
);
}, [] );

Expand Down

0 comments on commit ab97d28

Please sign in to comment.