1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Mobile: Added auto-save

This commit is contained in:
Laurent Cozic 2019-06-26 23:26:26 +01:00
parent 7942e74dc6
commit a1e8e71359

View File

@ -287,10 +287,23 @@ class NoteScreenComponent extends BaseScreenComponent {
title_changeText(text) { title_changeText(text) {
shared.noteComponent_change(this, 'title', text); shared.noteComponent_change(this, 'title', text);
this.setState({ newAndNoTitleChangeNoteId: null }); this.setState({ newAndNoTitleChangeNoteId: null });
this.scheduleSave();
} }
body_changeText(text) { body_changeText(text) {
shared.noteComponent_change(this, 'body', text); shared.noteComponent_change(this, 'body', text);
this.scheduleSave();
}
scheduleSave() {
if (this.scheduleSaveIID_) {
clearTimeout(this.scheduleSaveIID_);
this.scheduleSaveIID_ = null;
}
this.scheduleSaveIID_ = setTimeout(async () => {
await shared.saveNoteButton_press(this);
}, 1000);
} }
async saveNoteButton_press(folderId = null) { async saveNoteButton_press(folderId = null) {