fix(core): correctly delete backups for new entries (#2265)

This commit is contained in:
Shawn Erquhart 2019-04-04 14:33:36 -04:00 committed by GitHub
parent f5e148f9a7
commit a6c51fe14d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,9 +237,9 @@ class Editor extends React.Component {
};
deleteBackup() {
const { deleteLocalBackup, collection, slug } = this.props;
const { deleteLocalBackup, collection, slug, newEntry } = this.props;
this.createBackup.cancel();
deleteLocalBackup(collection, slug);
deleteLocalBackup(collection, !newEntry && slug);
}
handlePersistEntry = async (opts = {}) => {