1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Desktop: Resolves #2681: Clear provisional flag as soon as note is modified to avoid data loss

This commit is contained in:
Laurent Cozic 2020-04-06 21:10:44 +00:00
parent 093fc811eb
commit 518af9dc0a

View File

@ -513,6 +513,13 @@ class NoteTextComponent extends React.Component {
}
scheduleSave() {
if (this.state.note && this.props.provisionalNoteIds.includes(this.state.note.id)) {
this.props.dispatch({
type: 'NOTE_PROVISIONAL_FLAG_CLEAR',
id: this.state.note.id,
});
}
if (this.scheduleSaveTimeout_) clearTimeout(this.scheduleSaveTimeout_);
this.scheduleSaveTimeout_ = setTimeout(() => {
this.saveIfNeeded();