bugfix in Draft entry editing
This commit is contained in:
parent
4d696f2253
commit
44bbb84d44
@ -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'))) {
|
||||
|
@ -51,6 +51,7 @@ export default function EntryPageHOC(EntryPage) {
|
||||
|
||||
return {
|
||||
...ownProps,
|
||||
...stateProps,
|
||||
...returnObj,
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user