You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
All: Better handling of encrypted data on UI side and prevent modification of encrypted notes
This commit is contained in:
@@ -37,16 +37,23 @@ shared.saveNoteButton_press = async function(comp) {
|
||||
}
|
||||
|
||||
// Save only the properties that have changed
|
||||
let diff = null;
|
||||
// let diff = null;
|
||||
// if (!isNew) {
|
||||
// diff = BaseModel.diffObjects(comp.state.lastSavedNote, note);
|
||||
// diff.type_ = note.type_;
|
||||
// diff.id = note.id;
|
||||
// } else {
|
||||
// diff = Object.assign({}, note);
|
||||
// }
|
||||
|
||||
// const savedNote = await Note.save(diff);
|
||||
|
||||
let options = {};
|
||||
if (!isNew) {
|
||||
diff = BaseModel.diffObjects(comp.state.lastSavedNote, note);
|
||||
diff.type_ = note.type_;
|
||||
diff.id = note.id;
|
||||
} else {
|
||||
diff = Object.assign({}, note);
|
||||
options.fields = BaseModel.diffObjectsFields(comp.state.lastSavedNote, note);
|
||||
}
|
||||
|
||||
const savedNote = await Note.save(diff);
|
||||
const savedNote = ('fields' in options) && !options.fields.length ? Object.assign({}, note) : await Note.save(note, { userSideValidation: true });
|
||||
|
||||
const stateNote = comp.state.note;
|
||||
// Re-assign any property that might have changed during saving (updated_time, etc.)
|
||||
|
||||
Reference in New Issue
Block a user