Skip to content

Commit

Permalink
Disable the Cancel button, too
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Jul 1, 2021
1 parent 8a16dce commit 9f807ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class PostPublishPanel extends Component {
isPublishSidebarEnabled,
isScheduled,
isSaving,
isSavingNonPostEntityChanges,
onClose,
onTogglePublishSidebar,
PostPublishExtension,
Expand Down Expand Up @@ -97,7 +98,11 @@ export class PostPublishPanel extends Component {
/>
</div>
<div className="editor-post-publish-panel__header-cancel-button">
<Button onClick={ onClose } variant="secondary">
<Button
disabled={ isSavingNonPostEntityChanges }
onClick={ onClose }
variant="secondary"
>
{ __( 'Cancel' ) }
</Button>
</div>
Expand Down Expand Up @@ -140,6 +145,7 @@ export default compose( [
isEditedPostBeingScheduled,
isEditedPostDirty,
isSavingPost,
isSavingNonPostEntityChanges,
} = select( editorStore );
const { isPublishSidebarEnabled } = select( editorStore );
const postType = getPostType( getEditedPostAttribute( 'type' ) );
Expand All @@ -156,6 +162,7 @@ export default compose( [
isPublished: isCurrentPostPublished(),
isPublishSidebarEnabled: isPublishSidebarEnabled(),
isSaving: isSavingPost(),
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
isScheduled: isCurrentPostScheduled(),
};
} ),
Expand Down

0 comments on commit 9f807ae

Please sign in to comment.