1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Electron, Mobile: Created alarm service and drivers

This commit is contained in:
Laurent Cozic
2017-11-27 22:50:46 +00:00
parent 748acdf03f
commit 9a40851c77
26 changed files with 367 additions and 85 deletions

View File

@@ -33,12 +33,22 @@ shared.saveNoteButton_press = async function(comp) {
if (isNew && !note.title) {
note.title = Note.defaultTitle(note);
}
note = await Note.save(note);
// Save only the properties that have changed
const diff = BaseModel.diffObjects(comp.state.lastSavedNote, note);
diff.type_ = note.type_;
diff.id = note.id;
const savedNote = await Note.save(diff);
// Re-assign any property that might have changed during saving (updated_time, etc.)
note = Object.assign(note, savedNote);
comp.setState({
lastSavedNote: Object.assign({}, note),
note: note,
});
if (isNew) Note.updateGeolocation(note.id);
comp.refreshNoteMetadata();
}