1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-14 23:26:58 +02:00

All: Improved: Do not save a revision if there is already a recent one that exists

This commit is contained in:
Laurent Cozic
2019-05-08 00:10:36 +01:00
parent 8ea1c373ed
commit a4db1bc671
3 changed files with 21 additions and 0 deletions

View File

@@ -87,6 +87,8 @@ class RevisionService extends BaseService {
output.body_diff = Revision.createTextPatch('', noteBody);
output.metadata_diff = Revision.createObjectPatch({}, noteMd);
} else {
if (Date.now() - parentRev.updated_time < Setting.value('revisionService.intervalBetweenRevisions')) return null;
const merged = await Revision.mergeDiffs(parentRev);
output.parent_id = parentRev.id;
output.title_diff = Revision.createTextPatch(merged.title, noteTitle);