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:
committed by
Oluwaseun Olorunsola
parent
e7169304e0
commit
bf5cde8363
@ -27,7 +27,7 @@ import {
|
|||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { storeName } from '../../store';
|
import { storeName, editorCurrentPostType } from '../../store';
|
||||||
import { MoreMenu } from './more-menu';
|
import { MoreMenu } from './more-menu';
|
||||||
import { PreviewDropdown } from '../preview';
|
import { PreviewDropdown } from '../preview';
|
||||||
import { SaveEmailButton } from './save-email-button';
|
import { SaveEmailButton } from './save-email-button';
|
||||||
@ -94,8 +94,8 @@ export function Header() {
|
|||||||
const { validateContent, isInvalid } = useContentValidation();
|
const { validateContent, isInvalid } = useContentValidation();
|
||||||
|
|
||||||
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
||||||
const hasTemplatesEdits = dirtyEntityRecords.some(
|
const hasNonEmailEdits = dirtyEntityRecords.some(
|
||||||
( entity ) => entity.name === 'wp_template'
|
( entity ) => entity.name !== editorCurrentPostType
|
||||||
);
|
);
|
||||||
|
|
||||||
const preventDefault = ( event ) => {
|
const preventDefault = ( event ) => {
|
||||||
@ -238,7 +238,7 @@ export function Header() {
|
|||||||
<div className="editor-header__settings edit-post-header__settings">
|
<div className="editor-header__settings edit-post-header__settings">
|
||||||
<SaveEmailButton />
|
<SaveEmailButton />
|
||||||
<PreviewDropdown />
|
<PreviewDropdown />
|
||||||
{ hasTemplatesEdits ? (
|
{ hasNonEmailEdits ? (
|
||||||
<SaveAllButton />
|
<SaveAllButton />
|
||||||
) : (
|
) : (
|
||||||
<SendButton
|
<SendButton
|
||||||
|
Reference in New Issue
Block a user