fix: duplicate entry (#3563)
This commit is contained in:
parent
0761ffa3f2
commit
1d88b15de5
@ -406,6 +406,7 @@ export function persistUnpublishedEntry(collection: Collection, existingUnpublis
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
dispatch(unpublishedEntryPersisted(collection, transactionID, newSlug));
|
dispatch(unpublishedEntryPersisted(collection, transactionID, newSlug));
|
||||||
|
if (!existingUnpublishedEntry) return dispatch(loadUnpublishedEntry(collection, newSlug));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(
|
dispatch(
|
||||||
notifSend({
|
notifSend({
|
||||||
|
@ -762,6 +762,7 @@ export function persistEntry(collection: Collection) {
|
|||||||
dispatch(loadMedia());
|
dispatch(loadMedia());
|
||||||
}
|
}
|
||||||
dispatch(entryPersisted(collection, serializedEntry, slug));
|
dispatch(entryPersisted(collection, serializedEntry, slug));
|
||||||
|
if (serializedEntry.get('newRecord')) return dispatch(loadEntry(collection, slug));
|
||||||
})
|
})
|
||||||
.catch((error: Error) => {
|
.catch((error: Error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -177,7 +177,6 @@ export class Editor extends React.Component {
|
|||||||
const newSlug = this.props.entryDraft && this.props.entryDraft.getIn(['entry', 'slug']);
|
const newSlug = this.props.entryDraft && this.props.entryDraft.getIn(['entry', 'slug']);
|
||||||
if (!prevProps.slug && newSlug && this.props.newEntry) {
|
if (!prevProps.slug && newSlug && this.props.newEntry) {
|
||||||
navigateToEntry(prevProps.collection.get('name'), newSlug);
|
navigateToEntry(prevProps.collection.get('name'), newSlug);
|
||||||
this.props.loadEntry(this.props.collection, newSlug);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!prevProps.localBackup && this.props.localBackup) {
|
if (!prevProps.localBackup && this.props.localBackup) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user