diff --git a/client/post-editor/controller.js b/client/post-editor/controller.js index bfaab5b5c14da..c0e4cad464ee5 100644 --- a/client/post-editor/controller.js +++ b/client/post-editor/controller.js @@ -24,7 +24,7 @@ import PostEditor from './post-editor'; import { setEditorPostId } from 'state/ui/editor/actions'; import { getSelectedSiteId } from 'state/ui/selectors'; import { getEditorPostId, getEditorPath } from 'state/ui/editor/selectors'; -import { editPost } from 'state/posts/actions'; +import { editPost, resetPostEdits } from 'state/posts/actions'; function getPostID( context ) { if ( ! context.params.post || 'new' === context.params.post ) { @@ -115,6 +115,7 @@ module.exports = { function startEditing( siteId ) { context.store.dispatch( setEditorPostId( postID ) ); + context.store.dispatch( resetPostEdits( siteId, postID ) ); context.store.dispatch( editPost( siteId, postID, { type: postType } ) ); if ( maybeRedirect( context ) ) { diff --git a/client/post-editor/post-editor.jsx b/client/post-editor/post-editor.jsx index a9cdbfeabf6c3..a95c6527b6fe7 100644 --- a/client/post-editor/post-editor.jsx +++ b/client/post-editor/post-editor.jsx @@ -158,7 +158,7 @@ export const PostEditor = React.createClass( { const { siteId, postId } = this.props; // When switching posts, reset post edits for the post we're leaving - if ( nextProps.postId !== postId ) { + if ( nextProps.siteId !== siteId || nextProps.postId !== postId ) { this.props.resetPostEdits( siteId, postId ); }