File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
packages/edit-post/src/components/start-page-options Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,20 @@ import { store as editPostStore } from '../../store';
14
14
export default function StartPageOptions ( ) {
15
15
const [ isClosed , setIsClosed ] = useState ( false ) ;
16
16
const { resetEditorBlocks } = useDispatch ( editorStore ) ;
17
- const postType = useSelect (
18
- ( select ) => select ( editorStore ) . getCurrentPostType ( ) ,
19
- [ ]
20
- ) ;
21
- const shouldEnableModal = useSelect ( ( select ) => {
22
- const { isCleanNewPost } = select ( editorStore ) ;
17
+ const { shouldOpenModal, postType } = useSelect ( ( select ) => {
18
+ const { isCleanNewPost, getCurrentPostType } = select ( editorStore ) ;
23
19
const { isEditingTemplate, isFeatureActive } = select ( editPostStore ) ;
24
20
25
- return (
26
- ! isEditingTemplate ( ) &&
27
- ! isFeatureActive ( 'welcomeGuide' ) &&
28
- isCleanNewPost ( )
29
- ) ;
21
+ return {
22
+ shouldOpenModal :
23
+ ! isEditingTemplate ( ) &&
24
+ ! isFeatureActive ( 'welcomeGuide' ) &&
25
+ isCleanNewPost ( ) ,
26
+ postType : getCurrentPostType ( ) ,
27
+ } ;
30
28
} , [ ] ) ;
31
29
32
- if ( isClosed || ! shouldEnableModal ) {
30
+ if ( isClosed || ! shouldOpenModal ) {
33
31
return null ;
34
32
}
35
33
You can’t perform that action at this time.
0 commit comments