diff --git a/src/containers/EntryPage.js b/src/containers/EntryPage.js index b6fda5b1..235d57be 100644 --- a/src/containers/EntryPage.js +++ b/src/containers/EntryPage.js @@ -38,17 +38,17 @@ class EntryPage extends React.Component { }; componentDidMount() { - const { entry, newEntry, collection, slug, createEmptyDraft, loadEntry } = this.props; + const { entry, newEntry, collection, slug, loadEntry } = this.props; if (newEntry) { createEmptyDraft(collection); } else { loadEntry(entry, collection, slug); - this.createDraft(entry); } } componentWillReceiveProps(nextProps) { if (this.props.entry === nextProps.entry) return; + if (nextProps.entry && !nextProps.entry.get('isFetching')) { this.createDraft(nextProps.entry); } else if (nextProps.newEntry) { @@ -82,6 +82,7 @@ class EntryPage extends React.Component { cancelEdit, } = this.props; + if (entryDraft == null || entryDraft.get('entry') === undefined || (entry && entry.get('isFetching'))) { diff --git a/src/containers/editorialWorkflow/EntryPageHOC.js b/src/containers/editorialWorkflow/EntryPageHOC.js index 50ad983a..b3010ab4 100644 --- a/src/containers/editorialWorkflow/EntryPageHOC.js +++ b/src/containers/editorialWorkflow/EntryPageHOC.js @@ -51,6 +51,7 @@ export default function EntryPageHOC(EntryPage) { return { ...ownProps, + ...stateProps, ...returnObj, }; }