diff --git a/packages/js/email-editor/src/store/selectors.ts b/packages/js/email-editor/src/store/selectors.ts index 3ff7080741..c2a1f1bfc0 100644 --- a/packages/js/email-editor/src/store/selectors.ts +++ b/packages/js/email-editor/src/store/selectors.ts @@ -140,16 +140,15 @@ export const getEditedEmailContent = createRegistrySelector( ); export const getSentEmailEditorPosts = createRegistrySelector( - ( select ) => () => { - const posts: EmailEditorPostType[] = select( - coreDataStore - ).getEntityRecords( 'postType', 'mailpoet_email', { - per_page: 30, // show a maximum of 30 for now - status: 'publish,sent', // show only sent emails - } ); - - return posts; - } + ( select ) => () => + select( coreDataStore ) + .getEntityRecords( 'postType', 'mailpoet_email', { + per_page: 30, // show a maximum of 30 for now + status: 'publish,sent', // show only sent emails + } ) + ?.filter( + ( post: EmailEditorPostType ) => post?.content?.raw !== '' // filter out empty content + ) ); /**