not creating note history immediatelly after creating a note since it's empty at that point which is useless

This commit is contained in:
azivner 2017-11-30 22:49:40 -05:00
parent 471821ebe5
commit 81719f84a0

View file

@ -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]); 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 () => { await sql.doInTransaction(async () => {
if (!existingNoteHistoryId) { if (!existingNoteHistoryId && (now - newNote.detail.date_created) >= historySnapshotTimeInterval) {
const newNoteHistoryId = utils.newNoteHistoryId(); const newNoteHistoryId = utils.newNoteHistoryId();
await sql.insert('notes_history', { await sql.insert('notes_history', {