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:
parent
7942e74dc6
commit
a1e8e71359
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user