fix recent notes (db & sync version increase)

This commit is contained in:
zadam
2019-05-21 21:47:28 +02:00
parent ced02b42b5
commit 29828f8e8f
16 changed files with 196 additions and 176 deletions

View File

@@ -148,13 +148,13 @@ async function updateOptions(entity, sourceId) {
}
async function updateRecentNotes(entity, sourceId) {
const orig = await sql.getRowOrNull("SELECT * FROM recent_notes WHERE branchId = ?", [entity.branchId]);
const orig = await sql.getRowOrNull("SELECT * FROM recent_notes WHERE noteId = ?", [entity.noteId]);
if (orig === null || orig.utcDateCreated < entity.utcDateCreated) {
await sql.transactional(async () => {
await sql.replace('recent_notes', entity);
await syncTableService.addRecentNoteSync(entity.branchId, sourceId);
await syncTableService.addRecentNoteSync(entity.noteId, sourceId);
});
}
}