From 81719f84a0a766895f4d149eb876b005c623747e Mon Sep 17 00:00:00 2001 From: azivner Date: Thu, 30 Nov 2017 22:49:40 -0500 Subject: [PATCH] not creating note history immediatelly after creating a note since it's empty at that point which is useless --- services/notes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/notes.js b/services/notes.js index c54f0dfe3..95e8cc4fb 100644 --- a/services/notes.js +++ b/services/notes.js @@ -150,7 +150,7 @@ async function updateNote(noteId, newNote, ctx) { const existingNoteHistoryId = await sql.getSingleValue("SELECT note_history_id FROM notes_history WHERE note_id = ? AND date_modified_from >= ?", [noteId, historyCutoff]); await sql.doInTransaction(async () => { - if (!existingNoteHistoryId) { + if (!existingNoteHistoryId && (now - newNote.detail.date_created) >= historySnapshotTimeInterval) { const newNoteHistoryId = utils.newNoteHistoryId(); await sql.insert('notes_history', {