Reset update to Header.tsx.

We need the button to show for other post types e.g wp_template, wp styles, etc

MAILPOET-6430
This commit is contained in:
Oluwaseun Olorunsola
2025-01-29 21:40:39 +01:00
committed by Oluwaseun Olorunsola
parent e7169304e0
commit bf5cde8363

View File

@ -27,7 +27,7 @@ import {
* Internal dependencies
*/
import { storeName } from '../../store';
import { storeName, editorCurrentPostType } from '../../store';
import { MoreMenu } from './more-menu';
import { PreviewDropdown } from '../preview';
import { SaveEmailButton } from './save-email-button';
@ -94,8 +94,8 @@ export function Header() {
const { validateContent, isInvalid } = useContentValidation();
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
const hasTemplatesEdits = dirtyEntityRecords.some(
( entity ) => entity.name === 'wp_template'
const hasNonEmailEdits = dirtyEntityRecords.some(
( entity ) => entity.name !== editorCurrentPostType
);
const preventDefault = ( event ) => {
@ -238,7 +238,7 @@ export function Header() {
<div className="editor-header__settings edit-post-header__settings">
<SaveEmailButton />
<PreviewDropdown />
{ hasTemplatesEdits ? (
{ hasNonEmailEdits ? (
<SaveAllButton />
) : (
<SendButton