unsaved changes cancel confirmation

This commit is contained in:
muerwre 2018-09-03 17:23:14 +07:00
parent 1ca2691a15
commit 3363708c1f
4 changed files with 50 additions and 1 deletions

View file

@ -23,7 +23,13 @@ export class EditorPanel extends React.PureComponent {
startSaveMode = () => this.props.editor.changeMode(MODES.SAVE);
stopEditing = () => this.props.editor.stopEditing();
stopEditing = () => {
if (!this.props.changed){
this.props.editor.stopEditing();
} else {
this.props.editor.changeMode(MODES.CONFIRM_CANCEL);
}
};
startEditing = () => this.props.editor.startEditing();