From ab97d28a55b028139b66b8199d795445d830cad8 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Fri, 8 Sep 2023 18:09:27 +0200 Subject: [PATCH] StartPageOptions: improve conditions to show modal only on a brand new page (#54245) * StartPageOptions: improve conditions to show modal only on brand new page * use isCleanNewPost --- .../edit-post/src/components/start-page-options/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/edit-post/src/components/start-page-options/index.js b/packages/edit-post/src/components/start-page-options/index.js index 8eafa5487b718f..02473fd4eaa148 100644 --- a/packages/edit-post/src/components/start-page-options/index.js +++ b/packages/edit-post/src/components/start-page-options/index.js @@ -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() ); }, [] );